protected void lnkSave_Click(object sender, EventArgs e) { if (Action == string.Empty || Action == Constants.ViewAction) { Action = Constants.InsertAction; } if (Action == Constants.InsertAction) { QueryArgument queryArgument = new QueryArgument(UserContext.DataBaseInfo) { FilterKey = Code, QueryType = Constants.TableAccounts }; if (_transactionManager.ValidateKey(queryArgument)) { CustomMessageControl.MessageBodyText = Code + " Party Code already exist"; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); return; } } var accounts = new Accounts(); accounts.Add(new Account { SName = Code, Name = Name, Type = LType, Created = CreatedDate, Sub = Constants.LedgerSub, LMode = LMode, FGroup = FGroup, ContactPerson = ContactPerson, Address = BasicAddress.DataSource, Parent = LType == Constants.Customers ? Constants.LabelCustomer : LType == Constants.Vendors ? Constants.LabelVendor : string.Empty, Action = Action, DataBaseInfo = UserContext.DataBaseInfo, }); if (_controlPanel.SetAccounts(accounts)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.PartyMasterSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "PARTYMASTER SAVED", GlobalCustomResource.PartyMasterSaved, true); clearForm(); DivAction = false; BindData(BindType.List); ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.PartyMasterFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "PARTYMASTER UPDATE FAILED", GlobalCustomResource.PartyMasterFailed, true); } }