protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e) { CustomProfile profile = CustomProfile.GetProfile(); iUC_AttachDocumentClient Document = new iUC_AttachDocumentClient(); mDocumentType DocType = new mDocumentType(); if (hdnstate.Value == "Edit") { DocType = Document.GetDocumentTypebyID(long.Parse(hdndocumenttypeID.Value), profile.DBConnection._constr); } DocType.DocumentType = txtdoctype.Text; DocType.Sequence = int.Parse(txtSequence.Text); DocType.Description = txtDescription.Text; DocType.CompanyID = long.Parse(ddlcompany.SelectedItem.Value); DocType.CustomerID = long.Parse(hdncustomerid.Value); DocType.CreatedBy = profile.Personal.UserID; DocType.CreationDate = DateTime.Now; DocType.Active = "Yes"; if (rbtnNo.Checked == true) { DocType.Active = "No"; } long DocTypeID = Document.SaveDocumentType(DocType, profile.DBConnection._constr); if (hdnstate.Value == "Edit") { WebMsgBox.MsgBox.Show("Record Updated Succefully!"); } else { WebMsgBox.MsgBox.Show("Record Save Succefully!"); } clear(); BindGrid(); }
protected void GetDocumentTypeByID(long DocTypeID) { CustomProfile profile = CustomProfile.GetProfile(); iUC_AttachDocumentClient Document = new iUC_AttachDocumentClient(); mDocumentType DocType = new mDocumentType(); DocType = Document.GetDocumentTypebyID(long.Parse(hdndocumenttypeID.Value), profile.DBConnection._constr); FillCompany(); if (DocType.CompanyID != null) { ddlcompany.SelectedIndex = ddlcompany.Items.IndexOf(ddlcompany.Items.FindByValue(DocType.CompanyID.ToString())); } hdnCompanyid.Value = DocType.CompanyID.ToString(); getCustomer(long.Parse(DocType.CompanyID.ToString())); if (DocType.CustomerID != null) { ddlcustomer.SelectedIndex = ddlcustomer.Items.IndexOf(ddlcustomer.Items.FindByValue(DocType.CustomerID.ToString())); } hdncustomerid.Value = DocType.CustomerID.ToString(); if (DocType.DocumentType != null) { txtdoctype.Text = DocType.DocumentType.ToString(); } if (DocType.Description != null) { txtDescription.Text = DocType.Description.ToString(); } if (DocType.Sequence != null) { txtSequence.Text = DocType.Sequence.ToString(); } if (DocType.Active == "No") { rbtnNo.Checked = true; } else { rbtnYes.Checked = true; } }