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(); }
public ActionResult DeleteConfirmed(string id) { mDocumentType mDocumentType = db.mDocumentTypes.Find(id); db.mDocumentTypes.Remove(mDocumentType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "code,name,status,remarks")] mDocumentType mDocumentType) { if (ModelState.IsValid) { db.Entry(mDocumentType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mDocumentType)); }
public ActionResult Create([Bind(Include = "code,name,status,remarks")] mDocumentType mDocumentType) { if (ModelState.IsValid) { db.mDocumentTypes.Add(mDocumentType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mDocumentType)); }
// GET: DocumentTypes/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } mDocumentType mDocumentType = db.mDocumentTypes.Find(id); if (mDocumentType == null) { return(HttpNotFound()); } return(View(mDocumentType)); }
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; } }