protected void btnSaveElementGroup_Click(object sender, EventArgs e) { try { initialDataBLL lookupBll = new initialDataBLL(); lookupBll.ElementGroupName = txtbxGroupName.Text; lookupBll.ElementGroupDes = txtDescription.Text; if (btnSave.Text != "Update") { if (lookupBll.checkDuplicateLookupGroup()) { bool Status = lookupBll.SaveLookUpGroup(); if (Status) { string message = " <span class='actionTopic'>" + " Data Saved Successfully as Id: " + lookupBll.ElementGroupId.ToString() + "</span>."; MyAlertBox( "var callbackOk = function () { window.location = \"/HRUI/LookUpData/ElementGroup/AddElementGroup.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", \"\");"); GetElementGroupList(); } } else { msgbox.Visible = true; msgTitleLabel.Text = "Duplicate Data"; msgTitleLabel.Text = "This Group is already Added."; } } else { lookupBll.ElementGroupId = hdbFieldId.Value; lookupBll.UpdateLookUpGroup(); btnSave.Text = "Save"; string message = " <span class='actionTopic'>" + " Data Updated Successfully of Id: " + lookupBll.ElementGroupId.ToString() + "</span>."; MyAlertBox( "var callbackOk = function () { window.location = \"/HRUI/LookUpData/ElementGroup/AddElementGroup.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", \"\");"); GetElementGroupList(); txtDescription.Text = ""; txtbxGroupName.Text = ""; } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } }
protected void EditLinkButton_OnClick(object sender, EventArgs e) { try { LinkButton lnkBtn = (LinkButton)sender; GridViewRow row = (GridViewRow)lnkBtn.NamingContainer; hdbFieldId.Value = gridviewInitialDataElement.Rows[row.RowIndex].Cells[0].Text.ToString(); initialDataBLL initialData = new initialDataBLL(); initialData.ElementDataId = hdbFieldId.Value; DataTable dt = initialData.GetElementDataById(); if (dt.Rows.Count > 0) { txtbxElementName.Text = dt.Rows[0]["ElementName"].ToString(); txtbxDescription.Text = dt.Rows[0]["Suffix"].ToString(); ddlGroup.SelectedValue = dt.Rows[0]["ElementGrpId"].ToString(); ; } btnSave.Text = "Update"; } catch (Exception ex) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } }
internal DataTable GetElementDataById(initialDataBLL initialDataBLL, LumexDBPlayer db) { DataTable dt = new DataTable(); try { db.AddParameters("@Id", initialDataBLL.ElementDataId.Trim()); dt = db.ExecuteDataTable("[GET_ELEMENT_DATA_BY_ID]", true); } catch (Exception) { throw; } return(dt); }
internal DataTable GetlookupdataNameIdbyGroup(initialDataBLL lookUpDataBLL, LumexDBPlayer db) { DataTable dt = new DataTable(); try { db.AddParameters("@GroupId", lookUpDataBLL.ElementGroupId.Trim()); dt = db.ExecuteDataTable("[GET_ELEMENT_NAME_ID_LIST_BY_GROUP_ID]", true); } catch (Exception) { throw; } return(dt); }
internal void UpdateLookUpGroup(initialDataBLL lookUpDataBLL, LumexDBPlayer db) { try { db.AddParameters("@ElementGrpId", lookUpDataBLL.ElementGroupId.Trim()); db.AddParameters("@ElementGrpName", lookUpDataBLL.ElementGroupName.Trim()); db.AddParameters("@Description", lookUpDataBLL.ElementGroupDes.Trim()); db.AddParameters("@ModifiedBy", LumexSessionManager.Get("ActiveUserId")); db.AddParameters("@ModifiedFrom", LumexLibraryManager.GetTerminal()); db.ExecuteNonQuery("[UPDATE_ELEMENT_GROUP]", true); } catch (Exception) { throw; } }
internal DataTable GetElementDataById(initialDataBLL initialDataBLL, LumexDBPlayer db) { DataTable dt = new DataTable(); try { db.AddParameters("@Id", initialDataBLL.ElementDataId.Trim()); dt = db.ExecuteDataTable("[GET_ELEMENT_DATA_BY_ID]", true); } catch (Exception) { throw; } return dt; }
internal void UpdateLookUpElementData(initialDataBLL lookUpDataBLL, LumexDBPlayer db) { try { db.AddParameters("@ElementId", lookUpDataBLL.ElementDataId.Trim()); db.AddParameters("@ElementName", lookUpDataBLL.ElementDataName.Trim()); db.AddParameters("@ElementGrpId", lookUpDataBLL.ElementGroupId.Trim()); db.AddParameters("@Suffix", lookUpDataBLL.ElementDataDescp.Trim()); db.AddParameters("@CreatedBy", LumexSessionManager.Get("ActiveUserId")); db.AddParameters("@CreatedFrom", LumexLibraryManager.GetTerminal()); db.ExecuteNonQuery("[UPDATE_ELEMENT_DATA]", true); } catch (Exception) { throw; } }
internal DataTable SaveLookUpGroup(initialDataBLL lookUpDataBLL, LumexDBPlayer db) { DataTable dt = new DataTable(); try { db.AddParameters("@ElementGrpName", lookUpDataBLL.ElementGroupName.Trim()); db.AddParameters("@Description", lookUpDataBLL.ElementGroupDes.Trim()); db.AddParameters("@CreatedBy", LumexSessionManager.Get("ActiveUserId")); db.AddParameters("@CreatedFrom", LumexLibraryManager.GetTerminal()); dt = db.ExecuteDataTable("[INSERT_ELEMENT_GROUP]", true); } catch (Exception) { throw; } return(dt); }
internal bool checkDuplicateLookupData(initialDataBLL lookUpDataBLL, LumexDBPlayer db) { bool status = true; DataTable dt = new DataTable(); try { db.AddParameters("@ElementGrpId", lookUpDataBLL.ElementGroupId.Trim()); db.AddParameters("@ElementName", lookUpDataBLL.ElementDataName.Trim()); dt = db.ExecuteDataTable("[CHECK_DUPLICATE_ELEMENT_DATA]", true); if (dt.Rows.Count > 0) { status = false; } } catch (Exception) { throw; } return status; }
internal bool checkDuplicateLookupData(initialDataBLL lookUpDataBLL, LumexDBPlayer db) { bool status = true; DataTable dt = new DataTable(); try { db.AddParameters("@ElementGrpId", lookUpDataBLL.ElementGroupId.Trim()); db.AddParameters("@ElementName", lookUpDataBLL.ElementDataName.Trim()); dt = db.ExecuteDataTable("[CHECK_DUPLICATE_ELEMENT_DATA]", true); if (dt.Rows.Count > 0) { status = false; } } catch (Exception) { throw; } return(status); }
protected void btnSave_Click(object sender, EventArgs e) { bool check = false; try { initialDataBLL initialData = new initialDataBLL(); initialData.ElementDataName = txtbxElementName.Text.Trim(); initialData.ElementDataDescp = txtbxDescription.Text.Trim(); initialData.ElementGroupId = ddlGroup.SelectedValue; if (btnSave.Text != "Update") { if (initialData.checkDuplicateLookupData()) { check = true; check = true; // MyAlertBox("Data has been saved successfully!!"); initialData.SaveLookUpElementData(); string message = " <span class='actionTopic'>" + " Data Saved Successfully as Id: " + initialData.ElementDataId.ToString() + "</span>."; MyAlertBox( "var callbackOk = function () { window.location = \"/a/initialdata/initialDataElement.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", \"\");"); } else { msgbox.Visible = true; msgTitleLabel.Text = "Duplicate Data"; msgTitleLabel.Text = "This Group is already Added."; } } else { initialData.ElementDataId = hdbFieldId.Value; initialData.ElementDataName = txtbxElementName.Text; initialData.ElementGroupId = ddlGroup.SelectedValue.ToString(); initialData.ElementDataDescp = txtbxDescription.Text; initialData.UpdateLookUpElementData(); btnSave.Text = "Save"; string message = " <span class='actionTopic'>" + " Data Updated Successfully of Id: " + initialData.ElementDataId.ToString() + "</span>."; MyAlertBox( "var callbackOk = function () { window.location = \"/a/initialdata/initialDataElement.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", \"\");"); txtbxElementName.Text = ""; txtbxDescription.Text = ""; ddlGroup.SelectedIndex = 0; } if (check == false) { MyAlertBox("Data save failed!!"); } getElementDataList(); } catch (Exception) { throw; } }
private void GetElementGroupNameId() { DataTable dt = new DataTable(); initialDataBLL LookUpBll = new initialDataBLL(); try { dt = LookUpBll.GetElementGroupNameIdList(); ddlGroup.DataSource = dt; ddlGroup.DataTextField = "Name"; ddlGroup.DataValueField = "Id"; ddlGroup.DataBind(); ddlGroup.Items.Insert(0, "Select Here.."); ddlGroup.SelectedIndex = 0; ddlGroup.Items[0].Value = ""; } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } }
private void getElementDataList() { try { initialDataBLL initialData = new initialDataBLL(); DataTable dt = initialData.GetElementDataList(); gridviewInitialDataElement.DataSource = dt; gridviewInitialDataElement.DataBind(); } catch (Exception) { throw; } }
private bool checkDuplicateElementData(initialDataBLL initialData) { bool status = false; try { status = initialData.checkDuplicateLookupData(); } catch (Exception) { //throw; } return status; }
internal DataTable SaveLookUpGroup(initialDataBLL lookUpDataBLL, LumexDBPlayer db) { DataTable dt = new DataTable(); try { db.AddParameters("@ElementGrpName", lookUpDataBLL.ElementGroupName.Trim()); db.AddParameters("@Description", lookUpDataBLL.ElementGroupDes.Trim()); db.AddParameters("@CreatedBy", LumexSessionManager.Get("ActiveUserId")); db.AddParameters("@CreatedFrom", LumexLibraryManager.GetTerminal()); dt = db.ExecuteDataTable("[INSERT_ELEMENT_GROUP]", true); } catch (Exception) { throw; } return dt; }
protected void GetElementGroupList() { try { DataTable dt = new DataTable(); initialDataBLL lookupBll = new initialDataBLL(); dt = lookupBll.GetElementGroupList(); if (dt.Rows.Count > 0) { gridviewElementGroupList.DataSource = dt; gridviewElementGroupList.DataBind(); } GridviewStyle(); } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } }
private void getRelationData() { DataTable dt = new DataTable(); initialDataBLL LookUpBll = new initialDataBLL(); LookUpBll.ElementGroupId = "EG002"; try { dt = LookUpBll.GetElementDataListByGroupId(); ddlContactRelation.DataSource = dt; ddlContactRelation.DataTextField = "ElementName"; ddlContactRelation.DataValueField = "ElementId"; ddlContactRelation.DataBind(); ddlContactRelation.Items.Insert(0, "Select Relation.."); ddlContactRelation.SelectedIndex = 0; ddlContactRelation.Items[0].Value = ""; } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } }
internal DataTable GetElementDataListByGroupId(initialDataBLL lookUpDataBLL, LumexDBPlayer db) { DataTable dt = new DataTable(); try { db.AddParameters("@GroupId", lookUpDataBLL.ElementGroupId.Trim()); dt = db.ExecuteDataTable("[GET_ELEMENT_DATA_LIST_BY_GROUP_ID]", true); } catch (Exception) { throw; } return dt; }