protected void Page_Load(object sender, EventArgs e) { try { if (IsPostBack.IsFalse()) { ClientScript.RegisterClientScriptBlock(GetType(), "IsPostBack", "var isPostBack = true;", true); InitializieCombo(); ClearControls(); InitializeSession(); //EnableAllControls(false); } else { Page.ClientScript.GetPostBackEventReference(this, String.Empty); String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"]; if (Request["__EVENTTARGET"] == "SearchHK") { HouseKeepingList = new CustomList <HouseKeepingValue>(); HouseKeepingValue searchHK = Session[ASL.STATIC.StaticInfo.SearchSessionVarName] as HouseKeepingValue; HouseKeepingList.Add(searchHK); if (searchHK.IsNotNull()) { PopulateHKInformation(searchHK); } } } } catch (Exception ex) { throw ex; } }
private void InitializeCombo() { try { //Loding Company CustomList <HouseKeepingValue> OrgList = HouseKeepingValue.GetAllHouseKeepingValueForDropdown("Company");; ddlCompany.DataSource = OrgList; ddlCompany.DataTextField = "HKName"; ddlCompany.DataValueField = "HKID"; ddlCompany.DataBind(); ddlCompany.Items.Insert(0, new ListItem(String.Empty, String.Empty)); ddlCompany.SelectedIndex = 0; //if (((PageBase)this.Page).CurrentUserSession.IsAdmin && OrgList.Count > 1) //{ // ddlCompany.Items.Insert(0, new ListItem(String.Empty, String.Empty)); // ddlCompany.SelectedIndex = 0; //} //else //{ // ddlCompany_SelectedIndexChanged(null, null); // ddlCompany.Enabled = false; //} } catch (Exception ex) { throw (ex); } }
protected void btnDelete_Click(object sender, EventArgs e) { try { CustomList <HouseKeepingValue> lstHKEntry = HouseKeepingList; if (lstHKEntry.Count == 0) { HouseKeepingValue newHouseKeepingEntry = new HouseKeepingValue(); lstHKEntry.Add(newHouseKeepingEntry); } CustomList <HouseKeepingValue> lstParent = ParentList; CustomList <HousekeepingHierarchy> lstChild = ChildList; SetDataFromControls(ref lstHKEntry); if (!CheckUserAuthentication(lstHKEntry)) { return; } manager.DeleteHKEntry(ref lstHKEntry, ref lstParent, ref lstChild); this.SuccessMessage = (StaticInfo.DeletedSuccessfullyMsg); txtHKName.Text = string.Empty; txtShortName.Text = string.Empty; txtDescription.Text = string.Empty; txtAddress.Text = string.Empty; } catch (SqlException ex) { this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex)); } catch (Exception ex) { this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex)); } }
protected void btnSave_Click(object sender, EventArgs e) { try { CustomList <HouseKeepingValue> lstHKEntry = HouseKeepingList; if (lstHKEntry.Count == 0) { HouseKeepingValue newHouseKeepingEntry = new HouseKeepingValue(); lstHKEntry.Add(newHouseKeepingEntry); } CustomList <HouseKeepingValue> lstParent = ParentList; CustomList <HousekeepingHierarchy> lstChild = ChildList; CustomList <HousekeepingHierarchy> savedList = new CustomList <HousekeepingHierarchy>(); foreach (HouseKeepingValue hKV in lstParent) { if (hKV.IsSaved) { HousekeepingHierarchy childObj = ChildList.Find(f => f.ParentID == hKV.HKID); if (childObj.IsNotNull()) { savedList.Add(childObj); } else { HousekeepingHierarchy obj = new HousekeepingHierarchy(); obj.ParentID = hKV.HKID; savedList.Add(obj); } } else { HousekeepingHierarchy childObj = ChildList.Find(f => f.ParentID == hKV.HKID); if (childObj.IsNotNull()) { childObj.Delete(); savedList.Add(childObj); } } } SetDataFromControls(ref lstHKEntry); if (!CheckUserAuthentication(lstHKEntry)) { return; } manager.SaveHKEntry(ref lstHKEntry, ref savedList); this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg); } catch (SqlException ex) { this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex)); } catch (Exception ex) { this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex)); } }
override protected void OnInit(EventArgs e) { string strTable = string.Format("<table><tr style='font-size: 15px;'><td style='border: 1px solid #B6B3AE;padding:5px 30px 5px 30px'>Entity</td><td style='border: 1px solid #B6B3AE; padding:5px 30px 5px 30px'>Current Position</td><td style='border: 1px solid #B6B3AE; padding:5px 30px 5px 30px'>Post Position</td></tr></table>"); Panel1.Controls.Add(new LiteralControl(strTable)); Panel1.Controls.Add(new LiteralControl("<div style='float:left; width:100%;font-size: 13px '>")); Panel1.Controls.Add(new LiteralControl("<div style='float:left;width:15%'>")); _entityList = EntityList.GetPromotionHiararchy(Convert.ToInt32(ASL.Hr.DAO.enumsHr.enumEntitySetup.TransferCriteria)); int c = 0; foreach (EntityList M in _entityList) { Label lb; lb = new Label(); lb.ID = "lvl" + M.EntityName.ToString(); lb.Text = M.EntityName; lb.Width = 70; lb.CssClass.PadLeft(10); Panel1.Controls.Add(lb); Panel1.Controls.Add(new LiteralControl("<br/><br/>")); } Panel1.Controls.Add(new LiteralControl("</div>")); Panel1.Controls.Add(new LiteralControl("<div style='float:left;width:30%'>")); foreach (EntityList M in _entityList) { TextBox txt; txt = new TextBox(); txt.ID = "txtCurrent" + M.EntityName.ToString(); txt.Width = 100; txt.Attributes.Add("class", "txtwidth93px"); txt.CssClass.PadLeft(1); Panel1.Controls.Add(txt); Panel1.Controls.Add(new LiteralControl("<br/><br/>")); } Panel1.Controls.Add(new LiteralControl("</div>")); Panel1.Controls.Add(new LiteralControl("<div style='float:left;width:30%'>")); foreach (EntityList M in _entityList) { DropDownList ddl; ddl = new DropDownList(); ddl.ID = "ddlPost" + M.EntityName.ToString(); ddl.DataSource = HouseKeepingValue.GetAllHouseKeepingValueForDropdown(M.EntityName); ddl.DataTextField = "HkName"; ddl.DataValueField = "HkID"; ddl.DataBind(); ddl.Items.Insert(0, new ListItem(String.Empty, String.Empty)); ddl.SelectedIndex = 0; ddl.Width = 100; ddl.Attributes.Add("class", "txtwidth93px"); ddl.CssClass.PadLeft(1); Panel1.Controls.Add(ddl); Panel1.Controls.Add(new LiteralControl("<br/><br/>")); } Panel1.Controls.Add(new LiteralControl("</div>")); Panel1.Controls.Add(new LiteralControl("</div>")); base.OnInit(e); }
private void SetDataInControls(HouseKeepingValue hk) { try { txtHKName.Text = hk.HKName; txtShortName.Text = hk.ShortName; txtDescription.Text = hk.Description; txtAddress.Text = hk.Address; } catch (Exception ex) { throw (ex); } }
private void PopulateHKInformation(HouseKeepingValue hK) { try { SetDataInControls(hK); ChildList = manager.GetAllHousekeepingHierarchy(hK.HKID); foreach (HouseKeepingValue hKV in ParentList) { if (ChildList.FindAll(f => f.ParentID == hKV.HKID).Count != 0) { hKV.IsSaved = true; } } } catch (Exception ex) { throw (ex); } }
private void SetDataFromControls(ref CustomList <HouseKeepingValue> lstHouseKeepingValue) { try { HouseKeepingValue objHKV = lstHouseKeepingValue[0]; objHKV.EntityID = ddlEntityType.SelectedValue.ToInt(); objHKV.HKName = txtHKName.Text; objHKV.ShortName = txtShortName.Text; objHKV.Description = txtDescription.Text; objHKV.Address = txtAddress.Text; if (objHKV.HKID != 0) { objHKV.SetModified(); } } catch (Exception ex) { throw ex; } }
private String GenerateReturnString() { try { String mode = HttpContext.Current.Request.QueryString["mode"]; String thisval = ""; switch (mode) { case "onSelectMode_Key1": thisval = HttpContext.Current.Request.QueryString["thisval"]; CustomList <HouseKeepingValue> retrievedData = HouseKeepingValue.GetAllHouseKeepingValueForDropdown(thisval.ToInt()); return(MakeString(retrievedData)); case "onSelectMode_Key2": thisval = HttpContext.Current.Request.QueryString["thisval"]; retrievedData = HouseKeepingValue.GetAllHouseKeepingValueForDropdown(thisval.ToInt()); return(MakeString(retrievedData)); case "onSelectMode_Key3": thisval = HttpContext.Current.Request.QueryString["thisval"]; retrievedData = HouseKeepingValue.GetAllHouseKeepingValueForDropdown(thisval.ToInt()); return(MakeString(retrievedData)); case "onSelectMode_Key4": thisval = HttpContext.Current.Request.QueryString["thisval"]; retrievedData = HouseKeepingValue.GetAllHouseKeepingValueForDropdown(thisval.ToInt()); return(MakeString(retrievedData)); case "onSelectMode_Key5": thisval = HttpContext.Current.Request.QueryString["thisval"]; retrievedData = HouseKeepingValue.GetAllHouseKeepingValueForDropdown(thisval.ToInt()); return(MakeString(retrievedData)); } } catch (Exception ex) { throw ex; } return(""); }
public CustomList <HouseKeepingValue> GetAllProject() { return(HouseKeepingValue.GetAllSingleEntity("spGetAllProject")); }
public CustomList <HouseKeepingValue> GetAllCustomerInfo() { return(HouseKeepingValue.GetAllCustomerInfo()); }
public CustomList <HouseKeepingValue> GetAllOfficialInfo() { return(HouseKeepingValue.GetAllOfficialInfo()); }
public CustomList <HouseKeepingValue> GetAllHouseKeepingValue() { return(HouseKeepingValue.GetAllHouseKeepingValue()); }
public CustomList <HouseKeepingValue> GetAllHouseKeepingValue(string entityKey) { return(HouseKeepingValue.GetAllHouseKeepingValue(entityKey)); }
public CustomList <HouseKeepingValue> GetAllHouseKeepingValueForDropdown(Int32 parentID) { return(HouseKeepingValue.GetAllHouseKeepingValueForDropdown(parentID)); }
public CustomList <HouseKeepingValue> GetCompany() { return(HouseKeepingValue.GetCompany()); }
public CustomList <HouseKeepingValue> GetAllHeadType() { return(HouseKeepingValue.GetAllSingleEntity("spGetHeadType")); }
protected void btnSave_Click(object sender, EventArgs e) { try { CustomList <RateDynamicGrid> lstRateDynamicGrid = RateDynamicGridList; CustomList <DataCaptureConfiguration> FieldList = manager.GetAllDataCaptureConfigurationForRate(); CustomList <DataCaptureRate> DataCaptureRateList = new CustomList <DataCaptureRate>(); foreach (RateDynamicGrid rDG in lstRateDynamicGrid) { string DataCapRateRuleID = ""; if (!rDG.IsUnchanged) { DataCaptureRate newObj1 = new DataCaptureRate(); DataCaptureRate newObj2 = new DataCaptureRate(); DataCaptureRate newObj3 = new DataCaptureRate(); DataCaptureRate newObj4 = new DataCaptureRate(); DataCaptureRate newObj5 = new DataCaptureRate(); DataCaptureRate newObj6 = new DataCaptureRate(); if (rDG.Key1 != 0 && rDG.Key1 != -1) { newObj1.RateKey = rDG.RateKey1; newObj1.Field = rDG.Key1; newObj1.Rate = rDG.Rate; newObj1.SetAdded(); DataCapRateRuleID = FieldList[0].Field + ":" + HouseKeepingValue.GetHKName(rDG.Key1); if (rDG.IsDeleted) { newObj1.DataCapRateRuleID = rDG.RateID; newObj1.Delete(); } } if (rDG.Key2 != 0 && rDG.Key2 != -1) { newObj2.RateKey = rDG.RateKey2; newObj2.Field = rDG.Key2; newObj2.Rate = rDG.Rate; newObj2.SetAdded(); DataCapRateRuleID += "-" + FieldList[1].Field + ":" + HouseKeepingValue.GetHKName(rDG.Key2); if (rDG.IsDeleted) { newObj2.DataCapRateRuleID = rDG.RateID; newObj2.Delete(); } } if (rDG.Key3 != 0 && rDG.Key3 != -1) { newObj3.RateKey = rDG.RateKey3; newObj3.Field = rDG.Key3; newObj3.Rate = rDG.Rate; newObj3.SetAdded(); DataCapRateRuleID += "-" + FieldList[2].Field + ":" + HouseKeepingValue.GetHKName(rDG.Key3); if (rDG.IsDeleted) { newObj3.DataCapRateRuleID = rDG.RateID; newObj3.Delete(); } } if (rDG.Key4 != 0 && rDG.Key4 != -1) { newObj4.RateKey = rDG.RateKey4; newObj4.Field = rDG.Key4; newObj4.Rate = rDG.Rate; if (rDG.RateKey4 == 0) { newObj4.SetAdded(); DataCapRateRuleID += "-" + FieldList[3].Field + ":" + HouseKeepingValue.GetHKName(rDG.Key4); } else if (rDG.IsDeleted) { newObj4.DataCapRateRuleID = rDG.RateID; newObj4.Delete(); } } if (rDG.Key5 != 0 && rDG.Key5 != -1) { newObj5.RateKey = rDG.RateKey5; newObj5.Field = rDG.Key5; newObj5.Rate = rDG.Rate; newObj5.SetAdded(); DataCapRateRuleID += "-" + FieldList[4].Field + ":" + HouseKeepingValue.GetHKName(rDG.Key5); if (rDG.IsDeleted) { newObj5.DataCapRateRuleID = rDG.RateID; newObj5.Delete(); } } if (rDG.Key6 != 0 && rDG.Key6 != -1) { newObj6.RateKey = rDG.RateKey6; newObj6.Field = rDG.Key6; newObj6.Rate = rDG.Rate; newObj6.SetAdded(); DataCapRateRuleID += "-" + FieldList[5].Field + ":" + HouseKeepingValue.GetHKName(rDG.Key6); if (rDG.IsDeleted) { newObj6.DataCapRateRuleID = rDG.RateID; newObj6.Delete(); } } if (newObj1.Field != 0 && newObj1.Field != -1) { DataCaptureRateList = new CustomList <DataCaptureRate>(); newObj1.DataCapRateRuleID = DataCapRateRuleID; DataCaptureRateList.Add(newObj1); if (!CheckUserAuthentication(DataCaptureRateList)) { return; } } if (newObj2.Field != 0 && newObj2.Field != -1) { newObj2.DataCapRateRuleID = DataCapRateRuleID; DataCaptureRateList.Add(newObj2); } if (newObj3.Field != 0 && newObj3.Field != -1) { newObj3.DataCapRateRuleID = DataCapRateRuleID; DataCaptureRateList.Add(newObj3); } if (newObj4.Field != 0 && newObj4.Field != -1) { newObj4.DataCapRateRuleID = DataCapRateRuleID; DataCaptureRateList.Add(newObj4); } if (newObj5.Field != 0 && newObj5.Field != -1) { newObj5.DataCapRateRuleID = DataCapRateRuleID; DataCaptureRateList.Add(newObj5); } if (newObj6.Field != 0 && newObj6.Field != -1) { newObj6.DataCapRateRuleID = DataCapRateRuleID; DataCaptureRateList.Add(newObj6); } manager.SaveDataDataCapture(ref DataCaptureRateList); } } this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg); } catch (SqlException ex) { this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex)); } catch (Exception ex) { this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex)); } }
public CustomList <HouseKeepingValue> GetAllHouseKeepingValue(string search, string blank) { return(HouseKeepingValue.GetAllHouseKeepingValue(search, blank)); }
public CustomList <HouseKeepingValue> GetAllHouseKeepingValue(Int32 entityID) { return(HouseKeepingValue.GetAllHouseKeepingValue(entityID)); }
public CustomList <HouseKeepingValue> GetAllHouseKeepingValueForDropdown(string entityName) { return(HouseKeepingValue.GetAllHouseKeepingValueForDropdown(entityName)); }