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); } }
protected void lnkSaveType_Click(object sender, EventArgs e) { var lnkbtn = sender as LinkButton; if (UpdateDetails(MaterialHierarchyType.Type)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.TypeSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "TYPE SAVED", GlobalCustomResource.TypeSaved, true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.TypeFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "TYPE UPDATE FAILED", GlobalCustomResource.TypeFailed, true); } fillTypeddl(); BindMaterialTypes(BindType.List); clearForm(); if (lnkbtn.ID == "lnkSaveTypeBtm") { ActiveStep = "3"; } }
protected void lnkBan_Click(object sender, EventArgs e) { var lnkbtn = sender as LinkButton; if (lnkbtn == null) { return; } Action = lnkbtn.CommandName; Code = lnkbtn.CommandArgument; var closeLink = (Control)sender; GridViewRow row = (GridViewRow)closeLink.NamingContainer; var hidSuspent = ((HiddenField)row.Cells[0].FindControl("hidSuspent")).Value.ToBool(); var queryArgument = new QueryArgument(UserContext.DataBaseInfo) { Key = Code, filter1 = hidSuspent ? "false" : "true", FilterKey = Constants.TableMaterials }; _controlPanel.Cancle(queryArgument); CustomMessageControl.MessageBodyText = GlobalCustomResource.MaterialSaved; CustomMessageControl.MessageBodyText = hidSuspent ? GlobalCustomResource.PartIncluded : GlobalCustomResource.PartSuspended; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, hidSuspent ? "Part Included" : "Part Suspended", hidSuspent ? GlobalCustomResource.PartIncluded : GlobalCustomResource.PartSuspended, true); Code = string.Empty; BindData(BindType.List); }
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 = CountryId, filter1 = Constants.CountryType, QueryType = Constants.TableMCatHeader }; if (_transactionManager.ValidateKey(queryArgument)) { CustomMessageControl.MessageBodyText = "Country Code already exist"; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); txtId.Focus(); return; } } var country = new Country { CountryId = CountryId, CountryName = CountryName, CurrencyCode = CurrencyCode, CurrencyName = CurrencyName.ToTrimString(), CurrencySymbol = CurrencySymbol, Denomination = Denomination, Action = Action, DataBaseInfo = UserContext.DataBaseInfo }; var countries = new Countries { country }; if (_controlPanel.SetCountry(countries)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.CountrySaved; CustomMessageControl.MessageType = MessageTypes.Success; AuditLog.LogEvent(SysEventType.INFO, "Country Saved", GlobalCustomResource.CountrySaved); ClearForm(); BindData(BindType.List); IsVisibleSave = false; txtId.Enabled = true; ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.CountryFailed; CustomMessageControl.MessageType = MessageTypes.Error; AuditLog.LogEvent(SysEventType.INFO, "Country update failed", GlobalCustomResource.CountryFailed); } CustomMessageControl.ShowMessage(); }
protected void lnkBan_Click(object sender, EventArgs e) { var closeLink = (Control)sender; GridViewRow row = (GridViewRow)closeLink.NamingContainer; var id = ((TextBox)row.FindControl("txtID")).Text.Trim(); if (id == string.Empty) { return; } var hidSuspent = ((HiddenField)row.Cells[0].FindControl("hidSuspent")).Value.ToBool(); var categories = new Categories(); categories.Add(new Category { CatType = Constants.PartType, CatCode = FRType, ID = ((TextBox)row.FindControl("txtID")).Text.ToUpper(), Description = ((TextBox)row.FindControl("txtDesp")).Text, CreatedDate = Dates.ToDateTime(((HiddenField)row.FindControl("hidCreatedDate")).Value.Trim(), DateFormat.Format_01), Action = Constants.UpdateAction, Suspend = !hidSuspent }); var firstOrDefault = categories.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.DataBaseInfo = UserContext.DataBaseInfo; } var controlPanel = new ControlPanelManager(); if (controlPanel.SetCategory(categories)) { CustomMessageControl.MessageBodyText = hidSuspent ? GlobalCustomResource.ModalityIncluded : GlobalCustomResource.ModalitySuspended; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, hidSuspent ? "Modality Included" : "Modality Suspended", hidSuspent ? GlobalCustomResource.ModalityIncluded : GlobalCustomResource.ModalitySuspended, true); lnkAddNew.Enabled = true; lnkAddNew.Style.Add("cursor", "Pointer"); BindData(null); } else { CustomMessageControl.MessageBodyText = hidSuspent ? GlobalCustomResource.ModalityIncludedFailed : GlobalCustomResource.ModalitySuspendedFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, hidSuspent ? "Modality Included FAILED" : "Modality Suspended FAILED", hidSuspent ? GlobalCustomResource.ModalityIncludedFailed : GlobalCustomResource.ModalitySuspendedFailed, true); } }
protected void lnkBan_Click(object sender, EventArgs e) { var closeLink = (Control)sender; GridViewRow row = (GridViewRow)closeLink.NamingContainer; var id = ((TextBox)row.FindControl("txtID")).Text.Trim(); if (id == string.Empty) { return; } var locations = new Locations(); var hidSuspent = ((HiddenField)row.Cells[0].FindControl("hidSuspent")).Value.ToBool(); locations.Add(new Location { Type = Type, Catg1 = Region, Catg2 = ddlRegion.SelectedItem.Text, Id = ((TextBox)row.FindControl("txtId")).Text.Trim().ToUpper(), Description = ((TextBox)row.FindControl("txtDescription")).Text, Parent = Constants.LabelWarehouse, Created = Dates.ToDateTime(((HiddenField)row.FindControl("hidCreatedDate")).Value.Trim(), DateFormat.Format_01), Suspend = !hidSuspent, Action = Constants.UpdateAction, }); var firstOrDefault = locations.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.DataBaseInfo = UserContext.DataBaseInfo; } if (_controlPanel.SetLocation(locations)) { CustomMessageControl.MessageBodyText = hidSuspent ? GlobalCustomResource.LocationIncluded : GlobalCustomResource.LocationSuspended; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, hidSuspent ?"LOCATION Included": "LOCATION Suspended", hidSuspent ? GlobalCustomResource.LocationIncluded : GlobalCustomResource.LocationSuspended, true); lnkAddNew.Enabled = true; lnkAddNew.Style.Add("cursor", "Pointer"); BindData(); } else { CustomMessageControl.MessageBodyText = hidSuspent ? GlobalCustomResource.LocationIncludedFailed : GlobalCustomResource.LocationSuspendedFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, hidSuspent ? "LOCATION Included FAILED" : "LOCATION Suspended FAILED", hidSuspent ? GlobalCustomResource.LocationIncludedFailed : GlobalCustomResource.LocationSuspendedFailed, true); } }
protected void lnkSave_Click(object sender, EventArgs e) { // Assign new action if action is empty or view if (Action == string.Empty || Action == Constants.ViewAction) { Action = Constants.InsertAction; } if (UserLoginId == string.Empty) { return; } if (UserContext == null) { AuditLog.LogEvent(SysEventType.ERROR, "Profile Creation", "Error : Error occured while creating New User Profile", new Exception("UserContext is null")); return; } QueryArgument queryArgument = new QueryArgument(UserContext.DataBaseInfo) { FilterKey = Action == Constants.InsertAction ? string.Empty : UserCode.ToString(), filter1 = UserLoginId, QueryType = Constants.ProfileValidationType }; var result = _transactionManager.ValidateKey(queryArgument); if (result) { CustomMessageControl.MessageBodyText = "Duplicate User ID"; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); txtUserId.Focus(); return; } if (UpdateUserDetails()) { CustomMessageControl.MessageBodyText = GlobalCustomResource.UserProfileSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "USERPROFILE SAVED", GlobalCustomResource.UserProfileSaved, true); ClearForm(); BindData(BindType.List); ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.UserProfileFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "USERPROFILE UPDATE FAILED", GlobalCustomResource.UserProfileFailed, true); } }
protected void lnkBan_Click(object sender, EventArgs e) { var closeLink = (Control)sender; GridViewRow row = (GridViewRow)closeLink.NamingContainer; var id = ((TextBox)row.FindControl("txtPrimary")).Text.Trim(); if (id == string.Empty) { return; } var units = new Units(); var hidSuspend = ((HiddenField)row.Cells[0].FindControl("hidSuspend")).Value.ToBool(); units.Add(new FBTS.Model.Control.Unit { //Type = Type, Id = ((TextBox)row.FindControl("txtPrimary")).Text.Trim().ToUpper(), Description = ((TextBox)row.FindControl("txtSecondary")).Text, Suspend = !hidSuspend, Action = Constants.UpdateAction, }); var firstOrDefault = units.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.DataBaseInfo = UserContext.DataBaseInfo; } if (_controlPanel.SetUom(units)) { CustomMessageControl.MessageBodyText = hidSuspend ? GlobalCustomResource.UOMIncluded : GlobalCustomResource.UOMSuspended; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, hidSuspend ? "UOM Included" : "UOM Suspended", hidSuspend ? GlobalCustomResource.UOMIncluded : GlobalCustomResource.UOMSuspended, true); lnkAddNew.Enabled = true; lnkAddNew.Style.Add("cursor", "Pointer"); BindData(); } else { CustomMessageControl.MessageBodyText = hidSuspend ? GlobalCustomResource.UOMIncludedFailed : GlobalCustomResource.UOMSuspendedFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, hidSuspend ? "UOM Included FAILED" : "UOM Suspended FAILED", hidSuspend ? GlobalCustomResource.UOMIncludedFailed : GlobalCustomResource.UOMSuspendedFailed, true); } }
protected void lnkSave_Click(object sender, EventArgs e) { var parts = new Materials(); parts.Add(new Material { PartNumber = Code, Description = Description, DetailedDescription = DetailedDescription, MaterialType = new MaterialType { Id = PartType }, MaterialGroup = new MaterialGroup { Id = PartGroup }, Unit = Unit, SalesPrice = SalesPrice, Created = CreatedDate, PriceValidDate = PriceValideDate }); var firstOrDefault = parts.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.DataBaseInfo = UserContext.DataBaseInfo; firstOrDefault.Action = Action; } if (_controlPanel.SetMaterials(parts)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.MaterialSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "MATERIALS SAVED", GlobalCustomResource.MaterialSaved, true); DivAction = false; clearForm(); BindData(BindType.List); ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.MaterialFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "MATERIALS UPDATE FAILED", GlobalCustomResource.MaterialFailed, true); } }
protected void lnkSave_Click(object sender, EventArgs e) { var locations = new Locations(); _locations = LocationDetails; foreach (GridViewRow gvRow in GridViewTable.Rows) { locations.Add(new Location { Type = Type, Catg1 = Region, Catg2 = ddlRegion.SelectedItem.Text, Id = ((TextBox)gvRow.FindControl("txtId")).Text.Trim().ToUpper(), Description = ((TextBox)gvRow.FindControl("txtDescription")).Text, Parent = Constants.LabelWarehouse, Created = Dates.ToDateTime(((HiddenField)gvRow.FindControl("hidCreatedDate")).Value.Trim(), DateFormat.Format_01), Suspend = ((HiddenField)gvRow.FindControl("hidSuspent")).Value.Trim().ToBool(), Action = (string.IsNullOrEmpty((((HiddenField)gvRow.FindControl("hdnAction")).Value)) ? Constants.UpdateAction : ((HiddenField)gvRow.FindControl("hdnAction")).Value), }); } var firstOrDefault = locations.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.DataBaseInfo = UserContext.DataBaseInfo; } if (_controlPanel.SetLocation(locations)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.LocationSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "LOCATION SAVED", GlobalCustomResource.LocationSaved, true); lnkAddNew.Enabled = true; lnkAddNew.Style.Add("cursor", "Pointer"); BindData(); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.LocationFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "LOCATION UPDATE FAILED", GlobalCustomResource.LocationFailed, true); } }
protected void lnkSave_Click(object sender, EventArgs e) { string relation1 = Categories.Where(x => x.Selected).Select(a => a.Value).ToList().ToCharSeperatedString(Constants.DelimeterSinglePipe); WFComponents teamMasters = new WFComponents(); teamMasters.Add(new WFComponent { ComponentType = Type, ComponentId = TeamId, ComponentDesp = TeamName, Relation1 = relation1, Action = Action, DataBaseInfo = UserContext.DataBaseInfo, }); WFComponentSubs wfComponentSubs = new WFComponentSubs(); wfComponentSubs.AddRange(Users.Where(x => x.Selected).ToList().Select(row => new WFComponentSub { WFCSCode = row.Value })); var firstOrDefault = teamMasters.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.wfComponentSubs = wfComponentSubs; } if (_controlPanel.SetTeams(teamMasters)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.TeamMasterSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "TEAM MASTER SAVED", GlobalCustomResource.TeamMasterSaved, true); ClearForm(); DivAction = false; BindData(BindType.List); ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.TeamMasterFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "TEAM MASTER UPDATE FAILED", GlobalCustomResource.TeamMasterFailed, true); } }
protected void lnkSave_Click(object sender, EventArgs e) { OrderTransactions orderTransactions = new OrderTransactions(); orderTransactions.Add(new OrderTransaction { OrderType = Constants.PurchaseRequestTdType, orderHead = ForecastingHead.GetData(), orderDetails = ForecastingPart.GVPartData, updateOrderDeatils = ForecastingPart.OrderDetailData, Action = Action, DataBaseInfo = UserContext.DataBaseInfo, StageId = TransactionStageControlId.ActiveStage.Trim(), Bu = UserContext.UserProfile.Bu, Off = Constants.TRNInProcessOFF, Branch = UserContext.UserProfile.Branch, LogedUser = UserContext.UserId, }); var firstOrDefault = orderTransactions.FirstOrDefault(); var references = getReferences(); if (firstOrDefault != null) { firstOrDefault.References = references; } if (_transactionManager.SetForcasting(orderTransactions)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.ForecastingSave; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Forecasting Saved", GlobalCustomResource.ForecastingSave, true); fillHeaderGrid(); DivAction = false; ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.ForecastingFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Forecasting Update Failed", GlobalCustomResource.ForecastingFailed, true); } }
protected void lnkSave_Click(object sender, EventArgs e) { var categories = new Categories(); lnkAddNew.Enabled = true; lnkAddNew.Style.Add("cursor", "Pointer"); foreach (GridViewRow gvRow in GridViewTable.Rows) { categories.Add(new Category { CatType = Constants.PartType, CatCode = FRType, ID = ((TextBox)gvRow.FindControl("txtID")).Text.ToUpper(), Description = ((TextBox)gvRow.FindControl("txtDesp")).Text, CreatedDate = Dates.ToDateTime(((HiddenField)gvRow.FindControl("hidCreatedDate")).Value.Trim(), DateFormat.Format_01), Action = (string.IsNullOrEmpty((((HiddenField)gvRow.FindControl("hdnAction")).Value)) ? Constants.UpdateAction : ((HiddenField)gvRow.FindControl("hdnAction")).Value), Suspend = false }); } var firstOrDefault = categories.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.DataBaseInfo = UserContext.DataBaseInfo; } var controlPanel = new ControlPanelManager(); if (controlPanel.SetCategory(categories)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.ModalitySaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Category SAVED", GlobalCustomResource.ModalitySaved, true); BindData(null); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.ModalityFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Category UPDATE FAILED", GlobalCustomResource.ModalityFailed, true); } }
protected void lnkSaveDesignation_Click(object sender, EventArgs e) { var designations = new Designations(); foreach (GridViewRow gvRow in GridViewTable.Rows) { designations.Add(new Designation { Id = ((TextBox)gvRow.FindControl("txtCode")).Text, Description = ((TextBox)gvRow.FindControl("txtDescription")).Text, Level = ((TextBox)gvRow.FindControl("txtAccess")).Text, Action = (string.IsNullOrEmpty((((HiddenField)gvRow.FindControl("hdnAction")).Value)) ? Constants.UpdateAction : ((HiddenField)gvRow.FindControl("hdnAction")).Value), SlNo = ((HiddenField)gvRow.FindControl("hdnSno")).Value, CreatedDate = Dates.ToDateTime(((HiddenField)gvRow.FindControl("hidCreatedDate")).Value, DateFormat.Format_05) }); } var firstOrDefault = designations.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.DataBaseInfo = UserContext.DataBaseInfo; } if (_controlPanel.SetDesignation(designations)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.DesignationSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "DESIGNATION SAVED", GlobalCustomResource.DesignationSaved, true); lnkAddNew.Enabled = true; lnkAddNew.Style.Add("cursor", "Pointer"); BindData(BindType.List); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.DesignationFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "DESIGNATION UPDATE FAILED", GlobalCustomResource.DesignationFailed, true); } }
protected void lnkSave_Click(object sender, EventArgs e) { var units = new Units(); lnkAddNew.Enabled = true; lnkAddNew.Style.Add("cursor", "Pointer"); foreach (GridViewRow gvRow in GridViewTable.Rows) { units.Add(new FBTS.Model.Control.Unit { Id = ((TextBox)gvRow.FindControl("txtPrimary")).Text.Trim().ToUpper(), Description = ((TextBox)gvRow.FindControl("txtSecondary")).Text.Trim().ToUpper(), Suspend = ((HiddenField)gvRow.FindControl("hidSuspend")).Value.Trim().ToBool(), Action = (string.IsNullOrEmpty((((HiddenField)gvRow.FindControl("hdnAction")).Value)) ? Constants.UpdateAction : ((HiddenField)gvRow.FindControl("hdnAction")).Value), }); } var firstOrDefault = units.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.DataBaseInfo = UserContext.DataBaseInfo; } if (_controlPanel.SetUom(units)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.UOMSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "UOM SAVED", GlobalCustomResource.UOMSaved, true); lnkAddNew.Enabled = true; lnkAddNew.Style.Add("cursor", "Pointer"); BindData(); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.UOMFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "UOM UPDATE FAILED", GlobalCustomResource.UOMFailed, true); } }
protected void lnkSave_Click(object sender, EventArgs e) { var menus = new Menus(); foreach (GridViewRow gvRow in gvMenuRights.Rows) { var checkBox = gvRow.FindControl("chkSelect") as CheckBox; if (checkBox != null && checkBox.Checked) { menus.Add(new FBTS.Model.Control.Menu { MenuCode = ((HiddenField)gvRow.FindControl("hidMenuCode")).Value, MenuOrder = Convert.ToDecimal(((TextBox)gvRow.FindControl("txtLevel")).Text) }); } } var menuAccessRights = new MenuAccessRights { AccessLevelId = SelectedAccessLevel, AccessRights = menus, DataBaseInfo = UserContext.DataBaseInfo }; if (_controlPanel.SetMenuAccessRights(menuAccessRights)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.AccessRightSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "ACCESS RIGHT SAVED", GlobalCustomResource.AccessRightSaved, true); lnkAddNew.Enabled = true; lnkAddNew.Style.Add("cursor", "Pointer"); BindData(BindType.List); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.AccessRightFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "ACCESS RIGHT UPDATE FAILED", GlobalCustomResource.AccessRightFailed, true); } }
protected void lnkSaveAccessLevel_Click(object sender, EventArgs e) { var menus = new Menus(); foreach (GridViewRow gvRow in gvMenuRights.Rows) { var checkBox = gvRow.FindControl("chkSelect") as CheckBox; if (checkBox != null && checkBox.Checked) { menus.Add(new FBTS.Model.Control.Menu { MenuCode = ((HiddenField)gvRow.FindControl("hidMenuCode")).Value, MenuOrder = Convert.ToDecimal(((TextBox)gvRow.FindControl("txtLevel")).Text) }); } } var menuAccessRights = new MenuAccessRights { UserId = UserCode, AccessRights = menus, DataBaseInfo = UserContext.DataBaseInfo }; //UserProfilePresenter.SaveMenuRights(menuAccessRights) if (_controlPanel.SetMenuAccessRights(menuAccessRights)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.UserProfileSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "USERPROFILE SAVED", GlobalCustomResource.UserProfileSaved, true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.UserProfileFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "USERPROFILE UPDATE FAILED", GlobalCustomResource.UserProfileFailed, true); } }
protected void lnkSaveGroup_Click(object sender, EventArgs e) { if (UpdateDetails(MaterialHierarchyType.Group)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.GroupSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "GROUP SAVED", GlobalCustomResource.GroupSaved, true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.GroupFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "GROUP UPDATE FAILED", GlobalCustomResource.GroupFailed, true); } BindMaterialGroups(BindType.List); clearForm(); }
protected void lnkSave_Click(object sender, EventArgs e) { if (UpdateUserDetails()) { CustomMessageControl.MessageBodyText = GlobalCustomResource.UserProfileSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "USERPROFILE SAVED", GlobalCustomResource.UserProfileSaved, true); ClearForm(); BindData(BindType.List); ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.UserProfileFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "USERPROFILE UPDATE FAILED", GlobalCustomResource.UserProfileFailed, true); } }
protected void lnkSave_Click(object sender, EventArgs e) { string relation1 = Constants.DelimeterSinglePipe + Teams.Where(x => x.Selected).Select(a => a.Value).ToList().ToCharSeperatedString(Constants.DelimeterSinglePipe); DataViewSetupInfo stageMasters = new DataViewSetupInfo(); stageMasters.Add(new DataViewSetup { DataType = Type, Id = StageId, Stage = StageName, Relation1 = relation1, Relation2 = SubLink, ActionLink = Link, Suspend = false, Referances = ReferencesData, DataBaseInfo = UserContext.DataBaseInfo, Action = Action }); if (_controlPanel.SetStages(stageMasters)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.StageMasterSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Stage MASTER SAVED", GlobalCustomResource.StageMasterSaved, true); ClearForm(); DivAction = false; BindData(BindType.List); ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.StageMasterFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Stage MASTER UPDATE FAILED", GlobalCustomResource.StageMasterFailed, true); } }
protected void Approve(object sender, EventArgs e) { var orderTransactions = new OrderTransactions(); var orderDeatils = new OrderDetails(); orderDeatils.Add(new OrderDetail { SlNo = ForecastingGridViewListControl.Amdno.Trim() }); orderTransactions.Add(new OrderTransaction { orderHead = new OrderHead { OrderNumber = ForecastingGridViewListControl.OrderNumber.Trim(), }, orderDetails = orderDeatils, Action = Constants.UpdateAction, DataBaseInfo = UserContext.DataBaseInfo, Off = Constants.TRNCompletedOFF, }); if (_transactionManager.SetFollowupApprove(orderTransactions)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.ApprovedSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Approved Data Saved", GlobalCustomResource.ApprovedSaved, true); fillHeaderGrid(); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.ApprovedFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Approved Data Update Failed", GlobalCustomResource.ApprovedFailed, true); } }
protected void lnkUpload_Click(object sender, EventArgs e) { string fileName = hidFileName.Value.Trim(); if (fileName == string.Empty) { return; } var msPath1 = Server.MapPath(Constants.UserExcelFileDirectory); new DirectoryInfo(msPath1).CreateDirectory(); fileName = fileName.Replace(@"C:\fakepath\", string.Empty); string strFileType = Path.GetExtension(fileName).ToLower(); string path = Path.Combine(msPath1, fileName); string connString = ""; //Connection String to Excel Workbook if (strFileType.Trim() == ".xls") { connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\""; } else if (strFileType.Trim() == ".xlsx") { //connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\""; connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;"; } string query = "SELECT Code,Name,ContactPerson,Address,Location,Country,State,Zip,Email,Phone,Mobile,WebSite FROM [Customer$]"; OleDbConnection conn = new OleDbConnection(connString); string script1 = string.Empty; int i = 1; try { if (conn.State == ConnectionState.Closed) { conn.Open(); } OleDbCommand cmd = new OleDbCommand(query, conn); OleDbDataReader odr = cmd.ExecuteReader(); var accounts = new Accounts(); while (odr.Read()) { i++; var code = odr["Code"].ToString().Trim(); if (string.IsNullOrEmpty(code)) { script1 += " - " + "Code is empty @ line No. : " + i.ToString(); } if (accounts.Where(x => x.SName == code).Any()) { script1 = code + " Party Code already exist"; } QueryArgument queryArgument = new QueryArgument(UserContext.DataBaseInfo) { FilterKey = code, QueryType = Constants.TableAccounts }; if (_transactionManager.ValidateKey(queryArgument)) { script1 = code + " Party Code already exist"; } var name = odr["Name"].ToString().Trim(); if (string.IsNullOrEmpty(name)) { script1 += " - " + "Code is empty @ line No. : " + i.ToString(); } var loc = odr["Location"].ToString().Trim(); if (string.IsNullOrEmpty(loc)) { script1 += " - " + "Location is empty @ line No. : " + i.ToString(); } var country = odr["Country"].ToString().Trim(); if (string.IsNullOrEmpty(country)) { script1 += " - " + "Country is empty @ line No. : " + i.ToString(); } var state = odr["State"].ToString().Trim(); if (string.IsNullOrEmpty(state)) { script1 += " - " + "State is empty @ line No. : " + i.ToString(); } if (script1 == string.Empty) { Action = Constants.InsertAction; accounts.Add(new Account { SName = code, Name = name, Type = LType, Created = CreatedDate, Sub = Constants.LedgerSub, LMode = LMode, FGroup = FGroup, ContactPerson = odr["ContactPerson"].ToString().Trim(), Address = new Address { Street = odr["Address"].ToString().Trim(), City = loc, State = state, Country = country, ZipCode = odr["Zip"].ToString().Trim(), Mobile = odr["Mobile"].ToString().Trim(), Email = odr["Email"].ToString().Trim(), Phone = odr["Phone"].ToString().Trim(), WebSite = odr["WebSite"].ToString().Trim(), }, Parent = LType == Constants.Customers ? Constants.LabelCustomer : LType == Constants.Vendors ? Constants.LabelVendor : string.Empty, Action = Action, DataBaseInfo = UserContext.DataBaseInfo, }); } else { CustomMessageControl.MessageBodyText = script1; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); break; } } if (script1 == string.Empty) { 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); } } } catch (Exception ex) { CustomMessageControl.MessageBodyText = ex.Message; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); } finally { conn.Close(); conn.Dispose(); } uplView.Update(); }
protected void lnkSaveState_Click(object sender, EventArgs e) { var states = new States(); lnkAddNew.Enabled = true; foreach (GridViewRow gvRow in GridViewState.Rows) { var action = ((HiddenField)gvRow.FindControl("hdnAction")).Value; var stateId = ((TextBox)gvRow.FindControl("txtStateId")).Text.ToTrimString(); states.Add(new State { //Slno = gvRow.FindControl("lblRowIndex")., StateId = stateId, StateName = ((TextBox)gvRow.FindControl("txtStateName")).Text, Action = action, DataBaseInfo = UserContext.DataBaseInfo }); if (action == Constants.InsertAction) { QueryArgument queryArgument = new QueryArgument(UserContext.DataBaseInfo) { FilterKey = CountryId, filter1 = Constants.CountryType, filter2 = stateId, QueryType = Constants.TableMCatDetls }; if (_transactionManager.ValidateKey(queryArgument)) { CustomMessageControl.MessageBodyText = "State Code already exist"; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); ((TextBox)gvRow.FindControl("txtStateId")).Focus(); return; } } } if (states.Where(x => x.StateId.ToTrimString() == string.Empty).Any()) { CustomMessageControl.MessageBodyText = "Please Enter State ID"; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); return; } if (states.Where(x => x.StateName.ToTrimString() == string.Empty).Any()) { CustomMessageControl.MessageBodyText = "Please Enter State Name"; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); return; } if (Action == string.Empty || Action == Constants.ViewAction) { Action = Constants.InsertAction; } var country = new Country { CountryId = CountryId, CountryName = CountryName, CurrencyCode = CurrencyCode, CurrencyName = CurrencyName.ToTrimString(), CurrencySymbol = CurrencySymbol, Denomination = Denomination, Action = Action, DataBaseInfo = UserContext.DataBaseInfo, States = states }; var countries = new Countries { country }; if (_controlPanel.SetCountry(countries)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.StateSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(SysEventType.INFO, "STATE SAVED", GlobalCustomResource.StateSaved); BindData(BindType.Form); lnkAddState.Enabled = true; lnkAddState.Style.Add("cursor", "Pointer"); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.StateFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(SysEventType.INFO, "STATE UPDATE FAILED", GlobalCustomResource.StateFailed); } }
protected void Save_Click(object sender, EventArgs e) { OrderTransactions orderTransactions = new OrderTransactions(); var orderDetails = OrderTransactionsData.FirstOrDefault().orderDetails.Where(x => x.SlNo.Trim() == SlNoKey).ToList(); var orderDetails1 = OrderTransactionsData.FirstOrDefault().orderDetails.Where(x => x.SlNo.Trim() == SlNoKey).ToList(); if (orderDetails.Count == 0) { return; } var updateOrderDetails = new OrderDetails(); foreach (var orderdetail in orderDetails) { //orderdetail.LogisticOrderNumber = ForecastingEditPart.LogistiOrderNumber.Trim(); orderdetail.SQuantity += ForecastingEditPart.Quantity; if (StageType == Constants.BillTrackingType) { if (FilterOrder == Constants.PendingOrder && ForecastingEditPart.Quantity == ForecastingEditPart.RemaingQty) { orderdetail.Off = Constants.TRNCompletedOFF; } else { orderdetail.Off = Constants.TRNInProcessOFF; } } else { if (ForecastingEditPart.Quantity == ForecastingEditPart.RemaingQty) { orderdetail.Off = Constants.TRNInProcessOFF; } else { orderdetail.Off = Constants.TRNLogedOFF; } } if (ForecastingEditPart.CurrentStatus == Constants.OrderingType || ForecastingEditPart.CurrentStatus == Constants.ChangeStatus || ForecastingEditPart.CurrentStatus == Constants.AlternativePartNeeded) { orderdetail.ShQuantity += ForecastingEditPart.Quantity; if (ForecastingEditPart.CurrentStatus == Constants.ChangeStatus) { orderdetail.BQuantity += ForecastingEditPart.Quantity; orderdetail.DoQuantity += ForecastingEditPart.Quantity; } orderdetail.LogisticOrderNumber = orderdetail.LogisticOrderNumber.Trim() + "," + ForecastingEditPart.LogistiOrderNumber.Trim(); } updateOrderDetails.Add(orderdetail); } var insertOrderDeatil = new OrderDetails(); foreach (var orderdetail in orderDetails1) { orderdetail.SQuantity = ForecastingEditPart.CurrentStatus == Constants.AlternativePartNeeded ? ForecastingEditPart.Quantity : 0; orderdetail.Quantity = ForecastingEditPart.Quantity; orderdetail.CurrentStatus = ForecastingEditPart.CurrentStatus; orderdetail.LogisticOrderNumber = ForecastingEditPart.LogistiOrderNumber.Trim(); insertOrderDeatil.Add(orderdetail); } var sqty = orderDetails.FirstOrDefault().Quantity; var qty = ForecastingEditPart.Quantity; orderTransactions.Add(new OrderTransaction { orderHead = ForecastingHead.GetData(), orderDetails = insertOrderDeatil, updateOrderDeatils = updateOrderDetails, Action = Action, DataBaseInfo = UserContext.DataBaseInfo, StageId = TransactionStageControlId.ActiveStage.Trim(), Bu = UserContext.UserProfile.Bu, Off = StageType == Constants.BillTrackingType ? ForecastingEditPart.CurrentStatus == Constants.OrderingType ? Constants.TRNCompletedOFF : Constants.TRNInProcessOFF : qty == ForecastingEditPart.RemaingQty ? Constants.TRNInProcessOFF : Constants.TRNLogedOFF, //Off = Constants.TRNInProcessOFF, Branch = UserContext.UserProfile.Branch, LogedUser = UserContext.UserId, FormType = FilterOrder == Constants.PendingOrder ? FormType.Pending : FormType.Fresh }); var firstOrDefault = orderTransactions.FirstOrDefault(); var references = getReferences(); if (firstOrDefault != null) { firstOrDefault.References = references; } if (_transactionManager.SetTeam(orderTransactions)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.TeamDataSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Team Data Saved", GlobalCustomResource.TeamDataSaved, true); ForecastingEditPart.clearForm(); // divEdit.Visible = false; divEdit.Attributes.Add("style", "display:none"); ClearReferences(); fillForm(); // ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.TeamDataFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Team Data Update Failed", GlobalCustomResource.TeamDataFailed, true); } }