using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BLL; namespace FineUIPro.Web.CQMS.Information { public partial class InstructionSheetEdit : PageBase { /// /// 主键 /// public string ContactSheetId { get { return (string)ViewState["ContactSheetId"]; } set { ViewState["ContactSheetId"] = value; } } /// /// 办理类型 /// public string State { get { return (string)ViewState["State"]; } set { ViewState["State"] = value; } } /// /// 附件 /// public int HandleImg { get { return Convert.ToInt32(ViewState["HandleImg"]); } set { ViewState["HandleImg"] = value; } } /// /// 表单只读 /// protected void EnableForm(string detail) { if (detail == "true" || detail == "next") { btnSubmit.Hidden = detail == "next" ? false : true; btnSave.Hidden = true; foreach (FormRow row in Form2.Rows) { foreach (Field field in row.Items) { if (field != null) { field.Readonly = true; } } } } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ContactSheetId = Request.Params["ContactSheetId"]; var detail = Request.Params["detail"]; EnableForm(detail); this.hdCreateMan.Text = CurrUser.UserId; if (!string.IsNullOrEmpty(ContactSheetId)) { BindGrid(); } HandleImg = 0; this.drpDraftReasonType.DataTextField = "Text"; this.drpDraftReasonType.DataValueField = "Value"; this.drpDraftReasonType.DataSource = BLL.ContactSheetService.DraftReason1List(); this.drpDraftReasonType.DataBind(); this.drpInstallation.DataTextField = "Text"; this.drpInstallation.DataValueField = "Value"; this.drpInstallation.DataSource = BLL.Project_InstallationService.GetInstallationList(this.CurrUser.LoginProjectId); this.drpInstallation.DataBind(); this.drpCNProfessional.DataTextField = "ProfessionalName"; this.drpCNProfessional.DataValueField = "CNProfessionalId"; this.drpCNProfessional.DataSource = BLL.CNProfessionalService.GetList(); this.drpCNProfessional.DataBind(); this.DropCompany.DataTextField = "UnitName"; this.DropCompany.DataValueField = "UnitId"; this.DropCompany.DataSource = BLL.UnitService.GetUnitDropDownList(); this.DropCompany.DataBind(); //Funs.FineUIPleaseSelect(drpDesignType);//变更类型 Funs.FineUIPleaseSelect(drpHandleMan); this.HideOptions.Hidden = true; this.rblIsAgree.Hidden = true; if (!string.IsNullOrEmpty(ContactSheetId)) { this.hdContactSheetId.Text = ContactSheetId; Model.CQMS_Information_ContactSheet design = BLL.ContactSheetService.GetConfirmFormById(ContactSheetId); string unitType = string.Empty; this.txtContactSheetCode.Text = design.ContactSheetCode; if (!string.IsNullOrEmpty(design.CreatMan)) { this.hdCreateMan.Text = design.CreatMan; } if (!string.IsNullOrEmpty(design.DraftReasonCode)) { this.drpDraftReasonType.SelectedValue = design.DraftReasonCode; } if (!string.IsNullOrEmpty(design.DraftReasonCode)) { this.drpDraftReasonType1.SelectedValue = design.DraftReasonCode; } if (!string.IsNullOrEmpty(design.DName)) { this.txtDName.Text = design.DName; } if (design.RealCompletDate != null) { this.dpRealCompletDate.Text = string.Format("{0:yyyy-MM-dd}", design.RealCompletDate); } if (!string.IsNullOrEmpty(design.CompanyCode)) { this.DropCompany.SelectedValue = design.CompanyCode; } if (design.ArtificialInput.HasValue) { this.txtArtificialInput.Text = design.ArtificialInput + ""; } if (design.ProfessionCode != null) { this.drpCNProfessional.SelectedValue = design.ProfessionCode; } if (!string.IsNullOrEmpty(design.IsPo)) { this.IsPo.SelectedValue = design.IsPo; } if (design.InstallationCode != null) { this.drpInstallation.SelectedValue = design.InstallationCode; var unitWork = BLL.UnitWorkService.GetUnitWork(this.CurrUser.LoginProjectId, design.InstallationCode); this.drpUnitWork.DataTextField = "Text"; this.drpUnitWork.DataValueField = "Value"; this.drpUnitWork.DataSource = unitWork; this.drpUnitWork.DataBind(); this.drpUnitWork.SelectedValue = design.UnitWork; } if (!string.IsNullOrEmpty(design.DraftReasonCode)) { var data = BLL.ContactSheetService.DraftReason2ByCode(design.DraftReasonCode.Substring(0, 1)); this.drpDraftReasonType1.DataTextField = "DraftReason"; this.drpDraftReasonType1.DataValueField = "DraftReasonCode"; this.drpDraftReasonType1.DataSource = data; this.drpDraftReasonType1.DataBind(); this.drpDraftReasonType1.SelectedValue = design.DraftReasonCode; this.drpDraftReasonType.SelectedValue = data[0].DraftReasonType; } this.txtContents.Text = design.Contents; if (!string.IsNullOrEmpty(design.States)) { State = design.States; } else { State = BLL.Const.ContactSheet_Compile; this.HideOptions.Hidden = true; this.rblIsAgree.Hidden = true; } if (State != BLL.Const.InstructionSheet_AuditCompleted) { if (this.State == Const.InstructionSheet_Audit4) { var ArtificialInput = decimal.Parse(this.txtArtificialInput.Text.Trim()); ListItem[] lis = new ListItem[1]; if (ArtificialInput >= 500000) { lis[0] = new ListItem("建造部审核", Const.InstructionSheet_Audit5); } else if (ArtificialInput >= 150000) { lis[0] = new ListItem("分管副总经理审核", Const.InstructionSheet_Audit9); } else { lis[0] = new ListItem(" QA/QC经理确认", Const.InstructionSheet_Audit10); } this.drpHandleType.DataTextField = "Text"; this.drpHandleType.DataValueField = "Value"; drpHandleType.DataSource = lis; drpHandleType.DataBind(); this.drpHandleType.SelectedIndex = 0; } else { this.drpHandleType.DataTextField = "Text"; this.drpHandleType.DataValueField = "Value"; drpHandleType.DataSource = BLL.ContactSheetService.GetIHandleTypeByState(State, this.RadioButtonList1.SelectedValue); drpHandleType.DataBind(); } } if (State == BLL.Const.InstructionSheet_Compile || State == BLL.Const.InstructionSheet_ReCompile) { this.HideOptions.Visible = false; this.rblIsAgree.Visible = false; this.drpHandleMan.Enabled = true; this.drpHandleMan.DataTextField = "UserName"; this.drpHandleMan.DataValueField = "UserId"; this.drpHandleMan.DataSource = BLL.UserService.GetProjectUserListByProjectId(this.CurrUser.LoginProjectId); this.drpHandleMan.DataBind(); } else { this.drpHandleMan.DataTextField = "UserName"; this.drpHandleMan.DataValueField = "UserId"; this.drpHandleMan.DataSource = BLL.UserService.GetProjectUserListByProjectId(this.CurrUser.LoginProjectId); this.drpHandleMan.DataBind(); this.HideOptions.Hidden = false; this.rblIsAgree.Hidden = false; } //if (State == BLL.Const.ContactSheet_Compile || !string.IsNullOrEmpty(Request.Params["see"])) //{ // this.btnSave.Visible = false; // this.btnSubmit.Visible = false; // this.next.Hidden = true; //} if (State == Const.InstructionSheet_AuditCompleted) { this.btnSave.Visible = false; this.btnSubmit.Visible = false; this.next.Hidden = true; } } else { State = Const.Design_Compile; this.drpHandleType.DataTextField = "Text"; this.drpHandleType.DataValueField = "Value"; drpHandleType.DataSource = BLL.ContactSheetService.GetIHandleTypeByState(State, this.RadioButtonList1.SelectedValue); drpHandleType.DataBind(); this.drpHandleMan.DataTextField = "UserName"; this.drpHandleMan.DataValueField = "UserId"; this.drpHandleMan.DataSource = BLL.UserService.GetProjectUserListByProjectId(this.CurrUser.LoginProjectId); this.drpHandleMan.DataBind(); plApprove2.Hidden = true; } } } private void BindGrid() { string strSql = "select D.ContactSheetAuditId,ContactSheetId,U.UserName, AuditDate,Opinions,D.HandleStep,IsAgree from CQMS_Information_ContactSheetApprove D left join Sys_user U on D.AuditMan = U.UserId where ContactSheetId=@ContactSheetId and D.AuditDate is not null"; List listStr = new List(); listStr.Add(new SqlParameter("@ContactSheetId", ContactSheetId)); SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); gvApprove.RecordCount = tb.Rows.Count; tb = GetFilteredTable(gvApprove.FilteredData, tb); var table = this.GetPagedDataTable(gvApprove, tb); gvApprove.DataSource = table; gvApprove.DataBind(); } protected void btnSubmit_Click(object sender, EventArgs e) { if (BLL.CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DesignMenuId, BLL.Const.BtnSubmit)) { SavePauseNotice("submit"); } else { Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); } } protected void btnSave_Click(object sender, EventArgs e) { if (BLL.CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DesignMenuId, BLL.Const.BtnSave)) { SavePauseNotice("save"); } else { Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); } } /// /// 保存开工报告 /// private void SavePauseNotice(string saveType) { Model.CQMS_Information_ContactSheet design = new Model.CQMS_Information_ContactSheet(); design.ContactSheetCode = this.txtContactSheetCode.Text.Trim(); design.ProjectId = this.CurrUser.LoginProjectId; if (this.drpDraftReasonType1.SelectedValue != BLL.Const._Null) { design.DraftReasonCode = this.drpDraftReasonType1.SelectedValue; } else { Alert.ShowInTop("变更原因不能为空!", MessageBoxIcon.Warning); return; } if (this.drpInstallation.SelectedValue != BLL.Const._Null) { design.InstallationCode = this.drpInstallation.SelectedValue; } else { Alert.ShowInTop("装置不能为空!", MessageBoxIcon.Warning); return; } if (this.drpUnitWork.SelectedValue != BLL.Const._Null) { design.UnitWork = this.drpUnitWork.SelectedValue; } else { Alert.ShowInTop("单位工程不能为空!", MessageBoxIcon.Warning); return; } if (this.drpCNProfessional.SelectedValue != BLL.Const._Null) { design.ProfessionCode = this.drpCNProfessional.SelectedValue; } else { Alert.ShowInTop("所属专业不能为空!", MessageBoxIcon.Warning); return; } if (!string.IsNullOrEmpty(this.dpRealCompletDate.Text.Trim())) { design.RealCompletDate = Convert.ToDateTime(this.dpRealCompletDate.Text.Trim()); } if (this.DropCompany.SelectedValue != BLL.Const._Null) { design.CompanyCode = this.DropCompany.SelectedValue; } if (this.IsPo.SelectedValue != BLL.Const._Null) { design.IsPo = this.IsPo.SelectedValue; } design.Contents = this.txtContents.Text.Trim(); design.DName = this.txtDName.Text.Trim(); design.CreatMan = this.hdCreateMan.Text.Trim(); design.CIType = "I"; design.ArtificialInput = decimal.Parse(this.txtArtificialInput.Text.Trim()); if (saveType == "submit") { design.States = drpHandleType.SelectedValue.Trim(); } else { Model.CQMS_Information_ContactSheet design1 = BLL.ContactSheetService.GetConfirmFormById(ContactSheetId); if (design1 != null) { if (string.IsNullOrEmpty(design1.States)) { design.States = BLL.Const.Design_Compile; } else { design.States = design1.States; } } else { design.States = BLL.Const.Design_Compile; } } if (saveType == "submit" && this.drpHandleType.SelectedValue == Const.ContactSheet_Audit2) //计算相似度 { var contactSheets = BLL.ContactSheetService.getCListByProjectId(CurrUser.LoginProjectId, this.ContactSheetId); decimal likeRate = 0; string likeContactSheetId = string.Empty; foreach (var c in contactSheets) { decimal rate = BLL.CommonService.GetLikeRate(c.Contents, design.Contents); if (string.IsNullOrEmpty(likeContactSheetId)) //首次计算 { likeRate = rate; if (likeRate > 0) { likeContactSheetId = c.ContactSheetId; } } else { if (rate > likeRate) { likeRate = rate; likeContactSheetId = c.ContactSheetId; } } } design.LikeRate = likeRate; design.LikeContactSheetId = likeContactSheetId; } if (!string.IsNullOrEmpty(ContactSheetId)) { Model.CQMS_Information_ContactSheet design1 = BLL.ContactSheetService.GetConfirmFormById(ContactSheetId); Model.CQMS_Information_ContactSheetApprove approve1 = BLL.ContactSheetApproveService.GetDesignApproveByContactSheetId(ContactSheetId); if (approve1 != null && saveType == "submit") { approve1.AuditDate = DateTime.Now; approve1.Opinions = this.txtOpinions.Text.Trim(); BLL.ContactSheetApproveService.UpdateContactSheetApprove(approve1); } if (saveType == "submit") { design.AuditUser = null; Model.CQMS_Information_ContactSheetApprove approve = new Model.CQMS_Information_ContactSheetApprove(); approve.ContactSheetId = design1.ContactSheetId; if (this.drpHandleMan.SelectedValue != BLL.Const._Null) { approve.AuditMan = this.drpHandleMan.SelectedValue; } approve.HandleStep = this.drpHandleType.SelectedValue; BLL.ContactSheetApproveService.AddContactSheetApprove(approve); APICommonService.SendSubscribeMessage(approve.AuditMan, "工程联络单待办理", this.CurrUser.UserName, string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now)); } if (saveType == "save") { design.AuditUser = this.drpHandleMan.SelectedValue; } design.ContactSheetId = ContactSheetId; BLL.ContactSheetService.UpdateConfirmForm(design); } else { if (!string.IsNullOrEmpty(this.hdContactSheetId.Text)) { design.ContactSheetId = this.hdContactSheetId.Text; } else { design.ContactSheetId = SQLHelper.GetNewID(typeof(Model.CQMS_Information_ContactSheet)); } if (saveType == "save") { design.AuditUser = this.drpHandleMan.SelectedValue; } design.CreatMan = this.CurrUser.UserId; design.CreatDate = DateTime.Now; BLL.ContactSheetService.AddConfirmForm(design); ContactSheetId = design.ContactSheetId; Model.CQMS_Information_ContactSheet design1 = BLL.ContactSheetService.GetConfirmFormById(ContactSheetId); if (saveType == "submit") { Model.CQMS_Information_ContactSheetApprove approve1 = new Model.CQMS_Information_ContactSheetApprove(); approve1.ContactSheetId = design.ContactSheetId; approve1.AuditDate = DateTime.Now; approve1.AuditMan = this.CurrUser.UserId; approve1.HandleStep = BLL.Const.Design_Compile; BLL.ContactSheetApproveService.AddContactSheetApprove(approve1); Model.CQMS_Information_ContactSheetApprove approve = new Model.CQMS_Information_ContactSheetApprove(); approve.ContactSheetId = design.ContactSheetId; if (this.drpHandleMan.SelectedValue != BLL.Const._Null) { approve.AuditMan = this.drpHandleMan.SelectedValue; } approve.HandleStep = this.drpHandleType.SelectedValue; if (this.drpHandleType.SelectedValue == BLL.Const.Design_Complete) { approve.AuditDate = DateTime.Now.AddMinutes(1); } BLL.ContactSheetApproveService.AddContactSheetApprove(approve); APICommonService.SendSubscribeMessage(approve.AuditMan, "工程联络单待办理", this.CurrUser.UserName, string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now)); } else { Model.CQMS_Information_ContactSheetApprove approve1 = new Model.CQMS_Information_ContactSheetApprove(); approve1.ContactSheetId = design.ContactSheetId; approve1.AuditMan = this.CurrUser.UserId; approve1.HandleStep = BLL.Const.Design_Compile; BLL.ContactSheetApproveService.AddContactSheetApprove(approve1); } } ShowNotify("提交成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } protected void drpDraftReasonType_SelectedIndexChanged(object sender, EventArgs e) { var selectedValue = this.drpDraftReasonType.SelectedValue; this.drpDraftReasonType1.DataTextField = "Text"; this.drpDraftReasonType1.DataValueField = "Value"; this.drpDraftReasonType1.DataSource = BLL.ContactSheetService.DraftReason2(selectedValue); this.drpDraftReasonType1.DataBind(); } protected void btnAttach_Click1(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.hdContactSheetId.Text)) //新增记录 { this.hdContactSheetId.Text = SQLHelper.GetNewID(typeof(Model.Check_Design)); } if (this.State == Const.InstructionSheet_Compile || this.State == Const.InstructionSheet_ReCompile) { PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId=A{1}&path=FileUpload/Design&menuId={2}", 0, this.hdContactSheetId.Text, BLL.Const.ConfirmMenuId))); } else { PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId=A{1}&path=FileUpload/Design&menuId={2}", -1, this.hdContactSheetId.Text, BLL.Const.ConfirmMenuId))); } } protected void btnAttach_Click2(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.hdContactSheetId.Text)) //新增记录 { this.hdContactSheetId.Text = SQLHelper.GetNewID(typeof(Model.Check_Design)); } PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId=B{1}&path=FileUpload/Design&menuId={2}", HandleImg, this.hdContactSheetId.Text, BLL.Const.ConfirmMenuId))); } /// /// 材料预计到齐时间文本框改变事件 /// /// /// protected void txtMaterialPlanReachDate_TextChanged(object sender, EventArgs e) { // this.txtPlanCompleteDate.Text = string.Empty; } /// /// 把状态转换代号为文字形式 /// /// /// protected string ConvertState(object state) { if (state != null) { if (state.ToString() == BLL.Const.InstructionSheet_ReCompile) { return "重新编制"; } else if (state.ToString() == BLL.Const.InstructionSheet_Compile) { return "变更录入"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit1) { return "施工经理审核"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit2) { return "项目费控经理/费控工程师审核"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit3) { return "控制经理审核"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit4) { return "现场负责人/项目经理审核"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit5) { return "建造部审核"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit6) { return "造价费控部审核"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit7) { return "审计部审核"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit8) { return "总经理审核"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit9) { return "副总经理审核"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit10) { return "QA/QC经理确认"; } else if (state.ToString() == BLL.Const.InstructionSheet_Audit11) { return "文控分发"; } else if (state.ToString() == BLL.Const.InstructionSheet_AuditCompleted) { return "审批完成"; } else { return ""; } } else { return ""; } } /// /// 办理步骤下拉框改变事件 /// /// /// protected void drpHandleType_SelectedIndexChanged(object sender, EventArgs e) { this.drpHandleMan.Items.Clear(); Funs.FineUIPleaseSelect(this.drpHandleMan); if (this.drpHandleType.SelectedValue == BLL.Const.ContactSheet_Compile) { this.drpHandleMan.Enabled = false; } else if (this.drpHandleType.SelectedValue == BLL.Const.ContactSheet_ReCompile) { this.drpHandleMan.Enabled = true; string userId = (from x in Funs.DB.CQMS_Information_ContactSheetApprove where x.ContactSheetId == ContactSheetId && x.HandleStep == BLL.Const.ContactSheet_Compile select x.AuditMan).First(); ListItem lis = new ListItem(BLL.UserService.GetUserByUserId(userId).UserName, userId); this.drpHandleMan.Items.Add(lis); this.drpHandleMan.SelectedIndex = 0; } else { this.drpHandleMan.Enabled = true; this.drpHandleMan.DataTextField = "UserName"; this.drpHandleMan.DataValueField = "UserId"; this.drpHandleMan.DataSource = BLL.UserService.GetProjectUserListByProjectId(this.CurrUser.LoginProjectId); this.drpHandleMan.DataBind(); this.drpHandleMan.SelectedIndex = 1; } } protected void drpInstallation_SelectedIndexChanged(object sender, EventArgs e) { var installtionId = this.drpInstallation.SelectedValue; var unitWork = BLL.UnitWorkService.GetUnitWork(this.CurrUser.LoginProjectId, installtionId); this.drpUnitWork.DataTextField = "Text"; this.drpUnitWork.DataValueField = "Value"; this.drpUnitWork.DataSource = unitWork; this.drpUnitWork.DataBind(); } /// /// 同意审核单选框改变事件 /// /// /// protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { this.drpHandleMan.Enabled = true; string State = BLL.ContactSheetService.GetConfirmFormById(ContactSheetId).States; if (this.RadioButtonList1.SelectedValue.Equals("true")) { if (this.State == Const.InstructionSheet_Audit4) { var ArtificialInput = decimal.Parse(this.txtArtificialInput.Text.Trim()); ListItem[] lis = new ListItem[1]; if (ArtificialInput >= 500000) { lis[0] = new ListItem("建造部审核", Const.InstructionSheet_Audit5); } else if (ArtificialInput >= 150000) { lis[0] = new ListItem("分管副总经理审核", Const.InstructionSheet_Audit9); } else { lis[0] = new ListItem(" QA/QC经理确认", Const.InstructionSheet_Audit10); } this.drpHandleType.DataTextField = "Text"; this.drpHandleType.DataValueField = "Value"; drpHandleType.DataSource = lis; drpHandleType.DataBind(); this.drpHandleType.SelectedIndex = 0; } else { this.drpHandleType.DataTextField = "Text"; this.drpHandleType.DataValueField = "Value"; drpHandleType.DataSource = BLL.ContactSheetService.GetIHandleTypeByState(State, this.RadioButtonList1.SelectedValue); drpHandleType.DataBind(); this.drpHandleType.SelectedIndex = 0; } this.drpHandleType.SelectedIndex = 0; this.drpHandleMan.Items.Clear(); this.drpHandleMan.DataTextField = "UserName"; this.drpHandleMan.DataValueField = "UserId"; this.drpHandleMan.DataSource = BLL.UserService.GetProjectUserListByProjectId(this.CurrUser.LoginProjectId); this.drpHandleMan.DataBind(); } else { this.drpHandleType.DataTextField = "Text"; this.drpHandleType.DataValueField = "Value"; drpHandleType.DataSource = BLL.ContactSheetService.GetIHandleTypeByState(State, this.RadioButtonList1.SelectedValue); drpHandleType.DataBind(); this.drpHandleType.SelectedIndex = 0; this.drpHandleMan.Items.Clear(); ListItem item = new ListItem(); Model.Sys_User user = BLL.UserService.GetUserByUserId(BLL.ContactSheetApproveService.GetAuditMan(ContactSheetId, this.drpHandleType.SelectedValue == "0" ? "1" : this.drpHandleType.SelectedValue).AuditMan); item.Value = user.UserId; item.Text = user.UserName; this.drpHandleMan.Items.Add(item); this.drpHandleMan.SelectedIndex = 0; } } } }