protected void lnkbtnHome_Click(object sender, EventArgs e) { try { if (Session["UserTypeId"] != null) { if (ML_Common.string2int(Session["UserTypeId"]) == 3) //Lab { Server.Transfer("~/frmLabDashBoard.aspx", false); } else if (ML_Common.string2int(Session["UserTypeId"]) == 2) //TeachTeam { Server.Transfer("~/frmDashBoard.aspx", false); } else if (ML_Common.string2int(Session["UserTypeId"]) == 1) //Admin { Server.Transfer("~/frmDashBoard.aspx", false); } else { Response.Redirect("~/SignedOff.html"); } } else { Response.Redirect("~/SignedOff.html"); } } catch (Exception ex) { Exception exx = ex; } }
protected void grdCanteenMaster_RowUpdating(object sender, GridViewUpdateEventArgs e) { TextBox txtCanteenTypeNameEdit = (TextBox)grdCanteenMaster.Rows[e.RowIndex].FindControl("txtCanteenTypeNameEdit"); //TextBox txtRemarksEdit = (TextBox)grdCanteenMaster.Rows[e.RowIndex].FindControl("txtRemarksEdit"); CheckBox txtRemarksEdit = (CheckBox)grdCanteenMaster.Rows[e.RowIndex].FindControl("txtRemarksEdit"); if (IsValid) { //errNumber = -1; BusinessClass objBusinessClass = new BusinessLayer.BusinessClass(); int lngId = ML_Common.string2int(grdCanteenMaster.DataKeys[e.RowIndex].Values[0].ToString()); ML_CokeType objML_CokeType = objBusinessClass.GetCokeTypeById(lngId); try { if (objML_CokeType != null) { objML_CokeType.CokeType = ML_Common.clean(txtCanteenTypeNameEdit.Text); objML_CokeType.Remarks = ML_Common.clean(txtRemarksEdit.Text); int obhReturn = objBusinessClass.UpdateCokeType(objML_CokeType); if (obhReturn == 1) { lblMsg.Visible = true; lblMsg.Text = "Record Update Successfully"; } else if (obhReturn == 2) { lblMsg.Text = "Ooops!OtherIssue..."; lblMsg.Visible = true; } else { lblMsg.Text = "Ooops!OtherIssue..."; lblMsg.Visible = true; } grdCanteenMaster.EditIndex = -1; FillGrid(); } } catch (SqlException sqlExc) { SqlException sqlEt = sqlExc; return; } catch (Exception ex) { Exception exc = ex;// LogManager.LogManager.WriteErrorLog(ex); } } }
public ML_CokeType GetCokeTypeByCokeTypeId(int CokeTypeId) { DataTable dt = new DataTable(); try { objML_CokeType = new ML_CokeType(); SqlParameter[] parameters = { #region Get Properties new SqlParameter("@CokeTypeId", CokeTypeId) #endregion }; this.Parameters = parameters; SqlDataReader sdr = SqlHelper.ExecuteReader(ML_Connection.CreateConnection().ToString(), CommandType.StoredProcedure, StoredProcedure.Name.usp_GetCokeTypeByCokeTypeId.ToString(), this.Parameters); if (sdr.HasRows) { dt.Load(sdr); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; objML_CokeType.Id = ML_Common.string2int32(ML_Common.clean(dr["Id"].ToString())); objML_CokeType.CokeTypeId = ML_Common.string2int32(ML_Common.clean(dr["CokeTypeId"].ToString())); objML_CokeType.CokeType = ML_Common.clean(dr["CokeType"].ToString()); objML_CokeType.Remarks = ML_Common.clean(dr["Remarks"].ToString()); objML_CokeType.IsActive = ML_Common.clean(dr["IsActive"].ToString()); objML_CokeType.IsArchive = ML_Common.clean(dr["IsArchive"].ToString()); objML_CokeType.CreatedDate = ML_Common.ToDateTimeSafe(ML_Common.clean(dr["CreatedDate"].ToString())); objML_CokeType.CreatedBy = ML_Common.clean(dr["CreatedBy"].ToString()); objML_CokeType.ModifiedDate = ML_Common.ToDateTimeSafe(ML_Common.clean(dr["ModifiedDate"].ToString())); objML_CokeType.ModifiedBy = ML_Common.clean(dr["ModifiedBy"].ToString()); objML_CokeType.CreatedByUserNameId = ML_Common.string2int(ML_Common.clean(dr["CreatedByUserNameId"].ToString())); } } } catch (Exception ex) { Exception exc = ex;// Exception exc=ex;// LogManager.LogManager.WriteErrorLog(ex); throw; } finally { //LogManager.LogManager.WriteTraceLog( } return(objML_CokeType); }
protected void grdItemCategoryMaster_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { int lngId = ML_Common.string2int(grdItemCategoryMaster.DataKeys[e.RowIndex].Values[0].ToString()); DeleteGridRowItem(lngId); FillGrid(); lblMsg.Visible = true; lblMsg.Text = string.Empty; } catch (Exception ex) { Exception exc = ex;// LogManager.LogManager.WriteErrorLog(ex); } }
protected void grdCokeSupplier_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { // Guid guid = ML_Common.String2Guid(grdCokeSupplier.DataKeys[e.RowIndex].Values[0].ToString()); int lngId = ML_Common.string2int(grdCokeSupplier.DataKeys[e.RowIndex].Values[0].ToString()); DeleteGridRowItem(lngId); ViewState["grdCokeSupplier"] = null; FillGrid(); FormFieldsClear(); //PanelEditFormDisplay(false); lblMsg.Visible = true; lblMsg.Text = string.Empty; } catch (Exception ex) { Exception exc = ex;// LogManager.LogManager.WriteErrorLog(ex); } }
protected void lnkbtnHome_Click(object sender, EventArgs e) { try { if (Session["UserTypeId"] != null) { if (ML_Common.string2int(Session["UserTypeId"]) == 3) //Administrator { Response.Redirect("~/frmLabDashBoard.aspx", false); } else if (ML_Common.string2int(Session["UserTypeId"]) == 2) //Admin { Response.Redirect("~/frmDashBoard.aspx", false); } else if (ML_Common.string2int(Session["UserTypeId"]) == 2) //User { Response.Redirect("frmLabDashBoard.aspx", false); } else if (ML_Common.string2int(Session["UserTypeId"]) == 5) //User { Response.Redirect("frmCSSDashBoard.aspx", false); } else if (ML_Common.string2int(Session["UserTypeId"]) == 6) //User { Response.Redirect("frmPotDashBoard.aspx", false); } else { Response.Redirect("~/frmDashBoard.aspx", false); } } else { Response.Redirect("~/frmDashBoard.aspx", false); } } catch (Exception ex) { Exception ext = ex; } }
public ML_CokeSupplier GetCokeSupplierByCokeSupplierId(int CokeSupplierId) { DataTable dt = new DataTable(); try { objML_CokeSupplier = new ML_CokeSupplier(); SqlParameter[] parameters = { #region Get Properties new SqlParameter("@CokeSupplierId", CokeSupplierId) #endregion }; this.Parameters = parameters; SqlDataReader sdr = SqlHelper.ExecuteReader(ML_Connection.CreateConnection().ToString(), CommandType.StoredProcedure, StoredProcedure.Name.usp_GetCokeSupplierByCokeSupplierId.ToString(), this.Parameters); if (sdr.HasRows) { dt.Load(sdr); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; objML_CokeSupplier.Id = ML_Common.string2int32(ML_Common.clean(dr["Id"].ToString())); objML_CokeSupplier.CokeSupplierId = ML_Common.string2int32(ML_Common.clean(dr["CokeSupplierId"].ToString())); objML_CokeSupplier.CokeSupplier = ML_Common.clean(dr["CokeSupplier"].ToString()); objML_CokeSupplier.Address1 = ML_Common.clean(dr["Address1"].ToString()); objML_CokeSupplier.Address2 = ML_Common.clean(dr["Address2"].ToString()); objML_CokeSupplier.Address3 = ML_Common.clean(dr["Address3"].ToString()); objML_CokeSupplier.CityName = ML_Common.clean(dr["CityName"].ToString()); objML_CokeSupplier.StateName = ML_Common.clean(dr["StateName"].ToString()); objML_CokeSupplier.PinCode = ML_Common.clean(dr["PinCode"].ToString()); objML_CokeSupplier.Title = ML_Common.clean(dr["Title"].ToString()); objML_CokeSupplier.CountryName = ML_Common.clean(dr["CountryName"].ToString()); objML_CokeSupplier.ContactPerson = ML_Common.clean(dr["ContactPerson"].ToString()); objML_CokeSupplier.MobNo = ML_Common.clean(dr["MobNo"].ToString()); objML_CokeSupplier.WebSite = ML_Common.clean(dr["WebSite"].ToString()); objML_CokeSupplier.Email = ML_Common.clean(dr["Email"].ToString()); objML_CokeSupplier.Remarks = ML_Common.clean(dr["Remarks"].ToString()); objML_CokeSupplier.IsActive = ML_Common.clean(dr["IsActive"].ToString()); objML_CokeSupplier.IsArchive = ML_Common.clean(dr["IsArchive"].ToString()); objML_CokeSupplier.CreatedDate = ML_Common.ToDateTimeSafe(ML_Common.clean(dr["CreatedDate"].ToString())); objML_CokeSupplier.CreatedBy = ML_Common.clean(dr["CreatedBy"].ToString()); objML_CokeSupplier.ModifiedDate = ML_Common.ToDateTimeSafe(ML_Common.clean(dr["ModifiedDate"].ToString())); objML_CokeSupplier.ModifiedBy = ML_Common.clean(dr["ModifiedBy"].ToString()); objML_CokeSupplier.CreatedByUserNameId = ML_Common.string2int(ML_Common.clean(dr["CreatedByUserNameId"].ToString())); } } } catch (Exception ex) { Exception exc = ex;// Exception exc=ex;// LogManager.LogManager.WriteErrorLog(ex); throw; } finally { //LogManager.LogManager.WriteTraceLog( } return(objML_CokeSupplier); }
protected void Page_Load(object sender, EventArgs e) { try { try { if (Session["UserNameId"] == null || Session["UserName"] == null || ML_Common.string2int(Session["UserTypeId"]) != 1) { Response.Redirect("Login.aspx", false); } //txtUserName.Text = Session["UserEmail"].ToString(); txtUserName.Text = Session["UserName"].ToString(); } catch (Exception ex) { Exception exc = ex; } } catch (Exception ex) { Exception exc = ex; } }
protected void grdItemCategoryMaster_RowUpdating(object sender, GridViewUpdateEventArgs e) { DropDownList ddlNewCategoryGroupCode = (DropDownList)grdItemCategoryMaster.Rows[e.RowIndex].FindControl("ddlNewCategoryGroupCode"); DropDownList ddlNewCanteenName = (DropDownList)grdItemCategoryMaster.Rows[e.RowIndex].FindControl("ddlNewCanteenName"); TextBox txtNewItemCategoryName = (TextBox)grdItemCategoryMaster.Rows[e.RowIndex].FindControl("txtNewItemCategoryName"); CheckBox ChStatusNew = (CheckBox)grdItemCategoryMaster.Rows[e.RowIndex].FindControl("ChStatusNew"); DropDownList ddlNewStartTime = (DropDownList)grdItemCategoryMaster.Rows[e.RowIndex].FindControl("ddlNewStartTime"); DropDownList ddlNewEndTime = (DropDownList)grdItemCategoryMaster.Rows[e.RowIndex].FindControl("ddlNewEndTime"); if (IsValid) { //errNumber = -1; BusinessClass objBusinessClass = new BusinessLayer.BusinessClass(); int lngId = ML_Common.string2int(grdItemCategoryMaster.DataKeys[e.RowIndex].Values[0].ToString()); ML_ItemCategoryMaster objML_ItemCategoryMaster = objBusinessClass.GetItemCategoryMasterByItemCategoryCode(lngId); try { if (objML_ItemCategoryMaster != null) { objML_ItemCategoryMaster.CategoryGroupCode = Convert.ToInt32(ML_Common.clean(ddlNewCategoryGroupCode.SelectedValue)); objML_ItemCategoryMaster.CanteenCode = Convert.ToInt32(ML_Common.clean(ddlNewCanteenName.SelectedValue)); objML_ItemCategoryMaster.ItemCategoryName = ML_Common.clean(txtNewItemCategoryName.Text); objML_ItemCategoryMaster.StartTime = Convert.ToDateTime(ML_Common.clean(ddlNewStartTime.SelectedValue)); objML_ItemCategoryMaster.EndTime = Convert.ToDateTime(ML_Common.clean(ddlNewEndTime.Text)); if (ChStatusNew.Checked) { objML_ItemCategoryMaster.ItemCategoryActive = 1; } else { objML_ItemCategoryMaster.ItemCategoryActive = 0; } int obhReturn = objBusinessClass.UpdateItemCategoryMaster(objML_ItemCategoryMaster); if (obhReturn == 1) { lblMsg.Visible = true; lblMsg.Text = "Record Update Successfully"; } else if (obhReturn == 2) { lblMsg.Text = "Ooops!OtherIssue..."; lblMsg.Visible = true; } else { lblMsg.Text = "Ooops!OtherIssue..."; lblMsg.Visible = true; } grdItemCategoryMaster.EditIndex = -1; FillGrid(); } } catch (SqlException sqlExc) { SqlException sqlEt = sqlExc; return; } catch (Exception ex) { Exception exc = ex;// LogManager.LogManager.WriteErrorLog(ex); } } }
protected void btnSave_Click(object sender, EventArgs e) { if (IsValid) { //errNumber = -1; try { objBusinessClass = new BusinessLayer.BusinessClass(); objML_CokeDynamicResult = new ML_CokeDynamicResult(); ML_CokeDynamic objML_CokeDynamic = null;// new ML_KeysPointChk(); objBusinessClass = new BusinessClass(); int CokeDynamicId = -1; int obhReturn = 0; DateTime dtDateandTime = System.DateTime.Now; if (ddlCokeType.SelectedIndex > 0) { foreach (GridViewRow row in grdCokeDynamicResult.Rows) { objML_CokeDynamic = new ML_CokeDynamic(); string txtCokeDynamicResult = string.Empty; TextBox mytxtCokeDynamicResult = (TextBox)row.FindControl("txtCokeDynamicResult"); if (mytxtCokeDynamicResult != null) { txtCokeDynamicResult = mytxtCokeDynamicResult.Text; } Label lblCokeDynamicId = (Label)row.FindControl("lblCokeDynamicId"); if (lblCokeDynamicId != null) { CokeDynamicId = ML_Common.string2int(lblCokeDynamicId.Text); objML_CokeDynamic = objBusinessClass.GetCokeDynamicByCokeDynamicId(CokeDynamicId); objML_CokeDynamicResult = new ML_CokeDynamicResult(); objML_CokeDynamicResult.CokeDynamicResult = objML_CokeDynamic.CokeDynamic; objML_CokeDynamicResult.CokeTypeId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlCokeType, true)); objML_CokeDynamicResult.CokeType = ML_Common.string2string(ML_Common.GetDropDownValue(ddlCokeType, false)); objML_CokeDynamicResult.CokeSupplierId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlCokeSupplierName, true)); objML_CokeDynamicResult.CokeSupplier = ML_Common.string2string(ML_Common.GetDropDownValue(ddlCokeSupplierName, false)); objML_CokeDynamicResult.AnalysisTypeId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlAnalysisType, true)); objML_CokeDynamicResult.AnalysisType = ML_Common.string2string(ML_Common.GetDropDownValue(ddlAnalysisType, false)); objML_CokeDynamicResult.CokeDynamicId = objML_CokeDynamicResult.CokeDynamicId; objML_CokeDynamicResult.CokeDynamic = objML_CokeDynamic.CokeDynamic; objML_CokeDynamicResult.FieldSize = objML_CokeDynamic.FieldSize; objML_CokeDynamicResult.FieldUnit = objML_CokeDynamic.FieldUnit; objML_CokeDynamicResult.FieldSpec = objML_CokeDynamic.FieldSpec; objML_CokeDynamicResult.MinValue = objML_CokeDynamic.MinValue; objML_CokeDynamicResult.MaxValue = objML_CokeDynamic.MaxValue; //objML_CokeDynamicResult.CokeDynamicId = ML_Common.string2string(txtCokeDynamicResult); objML_CokeDynamicResult.CokeTypeId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlCokeType, true)); objML_CokeDynamicResult.CokeType = ML_Common.string2string(ML_Common.GetDropDownValue(ddlCokeType, false)); objML_CokeDynamicResult.CokeSupplierId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlCokeSupplierName, true)); objML_CokeDynamicResult.CokeSupplier = ML_Common.string2string(ML_Common.GetDropDownValue(ddlCokeSupplierName, false)); objML_CokeDynamicResult.AnalysisTypeId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlAnalysisType, true)); objML_CokeDynamicResult.AnalysisType = ML_Common.string2string(ML_Common.GetDropDownValue(ddlAnalysisType, false)); objML_CokeDynamicResult.FieldSize = ML_Common.clean(objML_CokeDynamicResult.FieldSize); objML_CokeDynamicResult.FieldUnit = ML_Common.clean(objML_CokeDynamicResult.FieldUnit); objML_CokeDynamicResult.FieldSpec = ML_Common.clean(objML_CokeDynamicResult.FieldSpec); objML_CokeDynamicResult.MinValue = ML_Common.clean(objML_CokeDynamicResult.MinValue); objML_CokeDynamicResult.MaxValue = ML_Common.clean(objML_CokeDynamicResult.MaxValue); obhReturn = objBusinessClass.AddCokeDynamicResult(objML_CokeDynamicResult); } } if (obhReturn == 1) { lblMsg.Visible = true; lblMsg.Text = "Record Saved Successfully"; } FormFieldsClear(); } } catch (SqlException sqlExc) { SqlException sqlExt = sqlExc; return; } catch (Exception ex) { Exception exc = ex;// Exception exc=ex;// LogManager.LogManager.WriteErrorLog(ex); } } //if (IsValid ) //{ // //errNumber = -1; // try // { // objBusinessClass = new BusinessLayer.BusinessClass(); // objML_CokeDynamicResult = new ML_CokeDynamicResult(); // string strAdminLoginName = string.Empty; // if (Session["UserName"] != null) // { // strAdminLoginName = Session["UserName"].ToString(); // } // objML_CokeDynamicResult.Id = ML_Common.string2Long(ML_Common.clean(txtId.Text)); // objML_CokeDynamicResult.CokeDynamicResultId = ML_Common.string2Long(ML_Common.clean(txtCokeDynamicResultId.Text)); // objML_CokeDynamicResult.CokeDynamicResult = ML_Common.clean(txtCokeDynamicResult.Text); // objML_CokeDynamicResult.CokeDynamicId = ML_Common.string2int32(ML_Common.clean(txtCokeDynamicId.Text)); // objML_CokeDynamicResult.CokeDynamic = ML_Common.clean(txtCokeDynamic.Text); // objML_CokeDynamicResult.CPCokeId = ML_Common.string2int32(ML_Common.clean(txtCPCokeId.Text)); // objML_CokeDynamicResult.CPCokeName = ML_Common.clean(txtCPCokeName.Text); // objML_CokeDynamicResult.CokeTypeId = ML_Common.string2int32(ML_Common.clean(txtCokeTypeId.Text)); // objML_CokeDynamicResult.CokeType = ML_Common.clean(txtCokeType.Text); // objML_CokeDynamicResult.CokeSupplierId = ML_Common.string2int32(ML_Common.clean(txtCokeSupplierId.Text)); // objML_CokeDynamicResult.CokeSupplier = ML_Common.clean(txtCokeSupplier.Text); // objML_CokeDynamicResult.AnalysisTypeId = ML_Common.string2int32(ML_Common.clean(txtAnalysisTypeId.Text)); // objML_CokeDynamicResult.AnalysisType = ML_Common.clean(txtAnalysisType.Text); // objML_CokeDynamicResult.FieldSize = ML_Common.clean(txtFieldSize.Text); // objML_CokeDynamicResult.FieldUnit = ML_Common.clean(txtFieldUnit.Text); // objML_CokeDynamicResult.FieldSpec = ML_Common.clean(txtFieldSpec.Text); // objML_CokeDynamicResult.MinValue = ML_Common.clean(txtMinValue.Text); // objML_CokeDynamicResult.MaxValue = ML_Common.clean(txtMaxValue.Text); // // objML_CokeDynamicResult.IsActive = ML_Common.clean(ML_Common.bit2int(chkIsActive.Checked).ToString()); // // objML_CokeDynamicResult.IsArchive = ML_Common.clean(ML_Common.bit2int(chkIsArchive.Checked).ToString()); // // objML_CokeDynamicResult.CreatedDate = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString()); // // objML_CokeDynamicResult.CreatedBy = ML_Common.clean(string.Empty); // // objML_CokeDynamicResult.ModifiedDate = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString()); // // objML_CokeDynamicResult.ModifiedBy = ML_Common.clean(string.Empty); // int obhReturn = objBusinessClass.AddCokeDynamicResult(objML_CokeDynamicResult); // if (obhReturn == 1) // { // lblMsg.Visible = true; // lblMsg.Text = "Record Saved Successfully"; // } // else if (obhReturn == 2) // { // lblMsg.Text = "Record Already Exists!"; // lblMsg.Visible = true; // } // } // catch (SqlException sqlExc) // { // // LogManager.LogManager.WriteErrorLog(sqlExc); // foreach (SqlError error in sqlExc.Errors) // { // errNumber = error.Number; // } // if (errNumber == 50000) // { // } // return; // } // catch (Exception ex) // { // Exception exc = ex;// Exception exc=ex;// LogManager.LogManager.WriteErrorLog(ex); // } //} }