Exemple #1
0
        protected void grdCanteenMaster_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("ADD"))
            {
                TextBox txtNewCanteenTypeName = (TextBox)grdCanteenMaster.FooterRow.FindControl("txtNewCanteenTypeName");

                CheckBox txtNewRemarks = (CheckBox)grdCanteenMaster.FooterRow.FindControl("txtNewRemarks");
                if (IsValid)
                {
                    //errNumber = -1;
                    try
                    {
                        objBusinessClass = new BusinessLayer.BusinessClass();
                        objML_CokeType   = new ML_CokeType();

                        objML_CokeType.CokeType     = ML_Common.clean(txtNewCanteenTypeName.Text);
                        objML_CokeType.Remarks      = ML_Common.clean(txtNewRemarks.Text);
                        objML_CokeType.IsActive     = ML_Common.clean(ML_Common.bit2int(false).ToString());
                        objML_CokeType.IsArchive    = ML_Common.clean(ML_Common.bit2int(false).ToString());
                        objML_CokeType.CreatedDate  = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());
                        objML_CokeType.CreatedBy    = Session["UserName"].ToString();
                        objML_CokeType.ModifiedDate = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());
                        objML_CokeType.ModifiedBy   = ML_Common.clean(string.Empty);

                        int obhReturn = objBusinessClass.AddCokeType(objML_CokeType);

                        if (obhReturn == 1)
                        {
                            lblMsg.Visible = true;
                            lblMsg.Text    = "Record Saved Successfully";
                            FillGrid();
                        }
                        else if (obhReturn == 2)
                        {
                            lblMsg.Text    = "Record Already Exists!";
                            lblMsg.Visible = true;
                        }
                    }
                    catch (SqlException sqlExc)
                    {
                        // LogManager.LogManager.WriteErrorLog(sqlExc);
                        SqlException sqlEt = sqlExc;
                        return;
                    }
                    catch (Exception ex)
                    {
                        Exception exc = 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);
        }
        public ML_UserType GetUserTypeByUserType(string UserType)
        {
            DataTable dt = new DataTable();

            try
            {
                objML_UserType = new ML_UserType();
                SqlParameter[] parameters =
                {
                    #region Get Properties
                    new SqlParameter("@UserType", UserType)
                    #endregion
                };

                this.Parameters = parameters;
                SqlDataReader sdr = SqlHelper.ExecuteReader(ML_Connection.CreateConnection().ToString(), CommandType.StoredProcedure, StoredProcedure.Name.usp_GetUserTypeByUserType.ToString(), this.Parameters);



                if (sdr.HasRows)
                {
                    dt.Load(sdr);
                    if (dt.Rows.Count > 0)
                    {
                        DataRow dr = dt.Rows[0];
                        objML_UserType.Id                  = ML_Common.string2Int32(ML_Common.clean(dr["Id"].ToString()));
                        objML_UserType.UserTypeId          = ML_Common.string2Int32(ML_Common.clean(dr["UserTypeId"].ToString()));
                        objML_UserType.UserType            = ML_Common.clean(dr["UserType"].ToString());
                        objML_UserType.IsActive            = ML_Common.clean(dr["IsActive"].ToString());
                        objML_UserType.IsArchive           = ML_Common.clean(dr["IsArchive"].ToString());
                        objML_UserType.CreatedDate         = ML_Common.ToDateTimeSafe(ML_Common.clean(dr["CreatedDate"].ToString()));
                        objML_UserType.CreatedBy           = ML_Common.clean(dr["CreatedBy"].ToString());
                        objML_UserType.ModifiedDate        = ML_Common.ToDateTimeSafe(ML_Common.clean(dr["ModifiedDate"].ToString()));
                        objML_UserType.ModifiedBy          = ML_Common.clean(dr["ModifiedBy"].ToString());
                        objML_UserType.CreatedByUserNameId = ML_Common.string2Int32(dr["CreatedByUserNameId"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                Exception exx = ex;
                throw;
            }
            finally
            {
                //
            }
            return(objML_UserType);
        }
        protected void Show_Hide_OrdersGrid(object sender, EventArgs e)
        {
            ImageButton imgShowHide = (sender as ImageButton);
            GridViewRow row         = (imgShowHide.NamingContainer as GridViewRow);

            if (imgShowHide.CommandArgument == "Show")
            {
                row.FindControl("pnlOrders").Visible = true;
                imgShowHide.CommandArgument          = "Hide";
                imgShowHide.ImageUrl = "~/images/minus.png";

                //DataKey arr = grdSanitizationReport.DataKeys[row.RowIndex];

                //DataKeyArray arr2 = grdSanitizationReport.DataKeyNames

                string SanitizationResultId  = grdSanitizationReport.DataKeys[row.RowIndex].Values[1].ToString();
                string SanitizationStartDate = grdSanitizationReport.DataKeys[row.RowIndex].Values[2].ToString();
                string SanitizationEndDate   = grdSanitizationReport.DataKeys[row.RowIndex].Values[3].ToString();



                ViewState["SanitizationResultId"]  = null;
                ViewState["SanitizationStartDate"] = null;
                ViewState["SanitizationEndDate"]   = null;


                // long SanitizationResultId = (long)ViewState["SanitizationResultId"];
                ViewState["SanitizationResultId"]  = ML_Common.string2Long(SanitizationResultId);
                ViewState["SanitizationStartDate"] = ML_Common.ToDateTimeSafe(SanitizationStartDate);
                ViewState["SanitizationEndDate"]   = ML_Common.ToDateTimeSafe(SanitizationEndDate);

                GridView gvChild = row.FindControl("grdSanitizationSGP125TData") as GridView;
                BindChildGrid(gvChild);
            }
            else
            {
                row.FindControl("pnlOrders").Visible = false;
                imgShowHide.CommandArgument          = "Show";
                imgShowHide.ImageUrl = "~/images/plus.png";
            }
        }
Exemple #5
0
        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);
        }
        private void FillGrid()
        {
            try
            {
                DataTable DtList = null;

                ML_SanitizationReport objML_SanitizationReportSearch = new ML_SanitizationReport();

                if (ddlReportTypeSearch.SelectedIndex > 0 && !string.IsNullOrEmpty(txtFromDateSearch.Text) && !string.IsNullOrEmpty(txtToDateSearch.Text))
                {
                    objML_SanitizationReportSearch.ReportType = ML_Common.GetDropDownValue(ddlReportTypeSearch, true);
                    objML_SanitizationReportSearch.TagStatus  = null;

                    DateTime FromDateSearch = ML_Common.ToDateTimeSafe(txtFromDateSearch.Text);
                    DateTime ToDateSearch   = ML_Common.ToDateTimeSafe(txtToDateSearch.Text);

                    var FromTimeSearch = TimeSpan.Parse("00:00:00");
                    var FromFullDt     = FromDateSearch + FromTimeSearch; // 2010-06-26 01:16:50

                    var ToTimeSearch = TimeSpan.Parse("23:59:59");
                    var ToFullDt     = ToDateSearch + ToTimeSearch; // 2010-06-26 01:16:50

                    var From24Hour = FromFullDt.ToString("MM/dd/yyyy HH:mm:ss", CultureInfo.CurrentCulture);
                    var To24Hour   = ToFullDt.ToString("MM/dd/yyyy HH:mm:ss", CultureInfo.CurrentCulture);


                    objML_SanitizationReportSearch.FromDate = ML_Common.ToDateTimeSafeNull(From24Hour.ToString());
                    objML_SanitizationReportSearch.ToDate   = ML_Common.ToDateTimeSafeNull(To24Hour.ToString());

                    DtList = BindGridViewBySearch(objML_SanitizationReportSearch);
                }


                if (DtList != null)
                {
                    //DtList = (DataTable)ViewState["grdSanitizationReportTM"];
                    if (DtList.Rows.Count > 0)
                    {
                        grdSanitizationReport.DataSource = DtList;
                        grdSanitizationReport.DataBind();
                    }
                    else
                    {
                        DtList.Rows.Add(DtList.NewRow());
                        grdSanitizationReport.DataSource = DtList;
                        grdSanitizationReport.DataBind();

                        int TotalColumns = grdSanitizationReport.Rows[0].Cells.Count;
                        grdSanitizationReport.Rows[0].Cells.Clear();
                        grdSanitizationReport.Rows[0].Cells.Add(new TableCell());
                        grdSanitizationReport.Rows[0].Cells[0].ColumnSpan = TotalColumns;
                        grdSanitizationReport.Rows[0].Cells[0].Text       = "No Record Found";
                    }
                    UpdatePanelGrid.Update();
                }
            }
            catch (Exception ex)
            {
                Exception exc = ex;
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                //errNumber = -1;
                try
                {
                    objBusinessClass = new BusinessLayer.BusinessClass();
                    objML_UserName   = new ML_UserName();


                    objML_UserName.UserName  = ML_Common.clean(txtUserName.Text);
                    objML_UserName.FirstName = ML_Common.clean(txtFirstName.Text);
                    objML_UserName.LastName  = ML_Common.clean(txtLastName.Text);
                    objML_UserName.Email     = ML_Common.clean(txtEmail.Text);
                    objML_UserName.Telephone = ML_Common.clean(txtTelephone.Text);
                    objML_UserName.Mobile    = ML_Common.clean(txtMobile.Text);
                    objML_UserName.Password  = ML_Common.clean(txtPassword.Text);


                    objML_UserName.UserTypeId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlUserType, true));
                    objML_UserName.UserType   = ML_Common.string2string(ML_Common.GetDropDownValue(ddlUserType, false));

                    objML_UserName.ReTryAttempt   = 3;     // ML_Common.string2int32(ML_Common.clean(txtReTryAttempt.Text));
                    objML_UserName.IsLocked       = false; // ML_Common.string2Boolean(ML_Common.clean(txtIsLocked.Text));
                    objML_UserName.LockedDateTime = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());
                    objML_UserName.IsActive       = ML_Common.clean(ML_Common.bit2int(true).ToString());
                    objML_UserName.IsArchive      = ML_Common.clean(ML_Common.bit2int(false).ToString());
                    objML_UserName.CreatedDate    = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());

                    objML_UserName.ModifiedDate = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());


                    if (Session["UserName"] != null && Session["UserNameId"] != null)
                    {
                        objML_UserName.CreatedBy           = ML_Common.clean(Session["UserName"]);
                        objML_UserName.ModifiedBy          = ML_Common.clean(Session["UserName"]);
                        objML_UserName.CreatedByUserNameId = ML_Common.string2int32(ML_Common.clean(Session["UserNameId"]));
                    }


                    int obhReturn = objBusinessClass.AddUserName(objML_UserName);

                    if (obhReturn == 1)
                    {
                        lblMsg.Visible = true;
                        lblMsg.Text    = "Record Saved Successfully";
                        FormFieldsClear();
                    }
                    else if (obhReturn == 2)
                    {
                        lblMsg.Text    = "Record Already Exists!";
                        lblMsg.Visible = true;
                    }
                }
                catch (SqlException sqlExc)
                {
                    SqlException sqlExt = sqlExc;
                    return;
                }
                catch (Exception ex)
                {
                    Exception exx = ex;
                }
            }
        }
Exemple #8
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            lblMsg.Text     = string.Empty;
            lblMsgEdit.Text = string.Empty;
            if (IsValid)
            {
                //errNumber = -1;
                try
                {
                    BusinessClass objBusinessClass = new BusinessLayer.BusinessClass();
                    int           lngId            = Convert.ToInt32(ViewState["UserNameViewId"]);
                    ML_UserName   objML_UserName   = objBusinessClass.GetUserNameById(lngId);

                    objML_UserName.UserName  = ML_Common.clean(txtUserNameEdit.Text);
                    objML_UserName.FirstName = ML_Common.clean(txtFirstNameEdit.Text);
                    objML_UserName.LastName  = ML_Common.clean(txtLastNameEdit.Text);
                    objML_UserName.Email     = ML_Common.clean(txtEmailEdit.Text);
                    objML_UserName.Telephone = ML_Common.clean(txtTelephoneEdit.Text);
                    objML_UserName.Mobile    = ML_Common.clean(txtMobileEdit.Text);
                    objML_UserName.Remarks   = ML_Common.clean(txtRemarksEdit.Text);

                    objML_UserName.IsActive     = ML_Common.clean(ML_Common.bit2int(true).ToString());
                    objML_UserName.IsArchive    = ML_Common.clean(ML_Common.bit2int(false).ToString());
                    objML_UserName.CreatedDate  = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());
                    objML_UserName.CreatedBy    = ML_Common.clean(string.Empty);
                    objML_UserName.ModifiedDate = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());
                    objML_UserName.ModifiedBy   = ML_Common.clean(string.Empty);

                    if (Session["UserName"] != null && Session["UserNameId"] != null)
                    {
                        objML_UserName.CreatedBy           = ML_Common.clean(Session["UserName"]);
                        objML_UserName.ModifiedBy          = ML_Common.clean(Session["UserName"]);
                        objML_UserName.CreatedByUserNameId = ML_Common.string2int32(ML_Common.clean(Session["UserNameId"]));
                    }



                    int obhReturn = objBusinessClass.UpdateUserName(objML_UserName);
                    if (obhReturn == 1)
                    {
                        lblMsg.Text     = "Record Update Successfully";
                        lblMsgEdit.Text = "Record Update Successfully";
                        FormFieldsClear();
                    }
                    else if (obhReturn == 2)
                    {
                        lblMsg.Text = "Record Already Exists!";


                        lblMsgEdit.Text = "Record Already Exists!";
                    }
                    else
                    {
                        lblMsg.Text = "There are some issue while Updating!";


                        lblMsgEdit.Text = "There are some issue while Updating!";
                    }
                    UpdatePanelEdit.Update();
                }
                catch (SqlException sqlExc)
                {
                    SqlException sqlExt = sqlExc;
                    return;
                }
                catch (Exception ex)
                {
                    Exception exx = ex;
                }
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                //errNumber = -1;
                try
                {
                    objBusinessClass   = new BusinessLayer.BusinessClass();
                    objML_CokeSupplier = new ML_CokeSupplier();

                    objML_CokeSupplier.CokeSupplier  = ML_Common.string2string(txtCokeSupplier.Text);
                    objML_CokeSupplier.Address1      = ML_Common.clean(txtAddress1.Text);
                    objML_CokeSupplier.Address2      = ML_Common.clean(txtAddress2.Text);
                    objML_CokeSupplier.Address3      = ML_Common.clean(txtAddress3.Text);
                    objML_CokeSupplier.CityName      = string.Empty; // ML_Common.clean(txtCityName.Text);
                    objML_CokeSupplier.StateName     = string.Empty; // ML_Common.clean(txtStateName.Text);
                    objML_CokeSupplier.PinCode       = string.Empty; // ML_Common.clean(txtPinCode.Text);
                    objML_CokeSupplier.Title         = string.Empty; //ML_Common.clean(txtTitle.Text);
                    objML_CokeSupplier.CountryName   = string.Empty; //ML_Common.clean(txtCountryName.Text);
                    objML_CokeSupplier.ContactPerson = ML_Common.clean(txtContactPerson.Text);
                    objML_CokeSupplier.MobNo         = ML_Common.clean(txtMobNo.Text);
                    objML_CokeSupplier.WebSite       = string.Empty;// ML_Common.clean(txtWebSite.Text);
                    objML_CokeSupplier.Email         = ML_Common.clean(txtEmail.Text);
                    objML_CokeSupplier.Remarks       = ML_Common.clean(txtRemarks.Text);


                    objML_CokeSupplier.IsActive            = ML_Common.clean(ML_Common.bit2int(true).ToString());
                    objML_CokeSupplier.IsArchive           = ML_Common.clean(ML_Common.bit2int(false).ToString());
                    objML_CokeSupplier.CreatedDate         = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());
                    objML_CokeSupplier.CreatedBy           = ML_Common.clean(string.Empty);
                    objML_CokeSupplier.ModifiedDate        = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());
                    objML_CokeSupplier.ModifiedBy          = ML_Common.clean(string.Empty);
                    objML_CokeSupplier.CreatedByUserNameId = 1;// ML_Common.string2int(ML_Common.clean(txtCreatedByUserNameId.Text));



                    int obhReturn = objBusinessClass.AddCokeSupplier(objML_CokeSupplier);

                    if (obhReturn == 1)
                    {
                        lblMsg.Text = "Record Saved Successfully";
                        FormFieldsClear();
                    }
                    else
                    {
                        lblMsg.Text = "Record Already Exists!";
                        FormFieldsClear();
                    }
                }
                catch (SqlException sqlExc)
                {
                    lblMsg.Text = "Record Already Exists!";
                    SqlException sqlExt = sqlExc;
                    return;
                }
                catch (Exception ex)
                {
                    Exception exc = ex;// Exception exc=ex;// LogManager.LogManager.WriteErrorLog(ex);
                }
            }
        }
Exemple #10
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            lblMsg.Text     = string.Empty;
            lblMsgEdit.Text = string.Empty;

            if (IsValid)
            {
                //errNumber = -1;
                BusinessClass   objBusinessClass   = new BusinessLayer.BusinessClass();
                int             lngId              = Convert.ToInt32(ViewState["grdCokeSupplierId"]);
                ML_CokeSupplier objML_CokeSupplier = objBusinessClass.GetCokeSupplierById(lngId);
                try
                {
                    if (objML_CokeSupplier != null)
                    {
                        //  objML_CokeSupplier.Id = ML_Common.string2int32(ML_Common.clean(txtIdEdit.Text));

                        // objML_CokeSupplier.CokeSupplierId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlCokeSupplierEdit, true));
                        objML_CokeSupplier.CokeSupplier  = ML_Common.string2string(txtCokeSupplierEdit.Text);
                        objML_CokeSupplier.Address1      = ML_Common.clean(txtAddress1Edit.Text);
                        objML_CokeSupplier.Address2      = ML_Common.clean(txtAddress2Edit.Text);
                        objML_CokeSupplier.Address3      = ML_Common.clean(txtAddress3Edit.Text);
                        objML_CokeSupplier.CityName      = string.Empty; //ML_Common.clean(txtCityNameEdit.Text);
                        objML_CokeSupplier.StateName     = string.Empty; // ML_Common.clean(txtStateNameEdit.Text);
                        objML_CokeSupplier.PinCode       = string.Empty; //ML_Common.clean(txtPinCodeEdit.Text);
                        objML_CokeSupplier.Title         = string.Empty; // ML_Common.clean(txtTitleEdit.Text);
                        objML_CokeSupplier.CountryName   = string.Empty; // ML_Common.clean(txtCountryNameEdit.Text);
                        objML_CokeSupplier.ContactPerson = ML_Common.clean(txtContactPersonEdit.Text);
                        objML_CokeSupplier.MobNo         = ML_Common.clean(txtMobNoEdit.Text);
                        objML_CokeSupplier.WebSite       = string.Empty;// ML_Common.clean(txtWebSiteEdit.Text);
                        objML_CokeSupplier.Email         = ML_Common.clean(txtEmailEdit.Text);
                        objML_CokeSupplier.Remarks       = ML_Common.clean(txtRemarksEdit.Text);


                        objML_CokeSupplier.IsActive            = ML_Common.clean(ML_Common.bit2int(true).ToString());
                        objML_CokeSupplier.IsArchive           = ML_Common.clean(ML_Common.bit2int(false).ToString());
                        objML_CokeSupplier.CreatedDate         = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());
                        objML_CokeSupplier.CreatedBy           = ML_Common.clean(string.Empty);
                        objML_CokeSupplier.ModifiedDate        = ML_Common.ToDateTimeSafe(System.DateTime.Now.ToString());
                        objML_CokeSupplier.ModifiedBy          = ML_Common.clean(string.Empty);
                        objML_CokeSupplier.CreatedByUserNameId = 1;// ML_Common.string2int(ML_Common.clean(txtCreatedByUserNameIdEdit.Text));

                        //  int obhReturn = objBusinessClass.UpdateUniqueCokeSupplier(objML_CokeSupplier);
                        int obhReturn = objBusinessClass.UpdateCokeSupplier(objML_CokeSupplier);
                        if (obhReturn == 1)
                        {
                            lblMsg.Visible  = true;
                            lblMsg.Text     = "Record Update Successfully";
                            lblMsgEdit.Text = "Record Update Successfully";
                            ModalPopupExtenderEdit.Hide();
                            lblMsgEdit.Text = string.Empty;
                        }
                        else if (obhReturn == 2)
                        {
                            lblMsg.Text     = "Record Already Exists!";
                            lblMsgEdit.Text = "Record Already Exists!";
                            lblMsg.Visible  = true;
                            ModalPopupExtenderEdit.Hide();
                        }
                        else
                        {
                            lblMsg.Text     = "Ooops!OtherIssue...";
                            lblMsgEdit.Text = "Ooops!OtherIssue...";
                            lblMsg.Visible  = true;
                        }
                        FillGrid();
                    }
                }
                catch (SqlException sqlExc)
                {
                    SqlException sqlExt = sqlExc;
                    return;
                }
                catch (Exception ex)
                {
                    Exception exc = ex;// LogManager.LogManager.WriteErrorLog(ex);
                }
            }
        }