protected void btnSave_click(object sender, EventArgs e) { DocumentListMaster document = null; int DocumentListId = 0; int PolicyTypeId = 0; int clientID = Core.SessionHelper.getClientId(); Page.Validate("NewDocument"); if (!Page.IsValid) return; if (Session["DocumentListId"] == null) { // new document master document = new DocumentListMaster(); PolicyTypeId = Convert.ToInt32(ddlPolicyType.SelectedValue); document.clientID = clientID; document.DocumentName = txtDocument.Text.Trim(); document.PolicyTypeId = PolicyTypeId; document.IsActive = true; DocumentLisMasterManager.Save(document); } else { DocumentListId = Convert.ToInt32(Session["DocumentListId"]); document = DocumentLisMasterManager.GetDocumentMaster(DocumentListId); if (document != null) { document.DocumentName = txtDocument.Text.Trim(); DocumentLisMasterManager.Save(document); } } txtDocument.Text = ""; Session.Remove("DocumentListId"); bindDocumentList(); }
/// <summary> /// Deprecated Method for adding a new object to the DocumentListMasters EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToDocumentListMasters(DocumentListMaster documentListMaster) { base.AddObject("DocumentListMasters", documentListMaster); }
/// <summary> /// Create a new DocumentListMaster object. /// </summary> /// <param name="documentListId">Initial value of the DocumentListId property.</param> public static DocumentListMaster CreateDocumentListMaster(global::System.Int32 documentListId) { DocumentListMaster documentListMaster = new DocumentListMaster(); documentListMaster.DocumentListId = documentListId; return documentListMaster; }