private void Page_Load(object sender, System.EventArgs e)
 {
     if (!IsPostBack)
     {
         BusinessClass bc = new BusinessClass();
         DataGrid1.DataSource = bc.GetData();
         DataGrid1.DataBind();
     }
 }
        protected void btnRecordUpdate_Click(object sender, EventArgs e)
        {
            lblMsg.Text = string.Empty;
            // lblMsgEdit.Text = string.Empty;


            if (IsValid && ViewState["grdSanitizationReportId"] != null)
            {
                errNumber = -1;
                BusinessClass objBusinessClass = new BusinessLayer.BusinessClass();
                int           lngId            = Convert.ToInt32(ViewState["grdSanitizationReportId"]);
                ML_SanitizationSGP125TData objML_SanitizationSGP125TData = objBusinessClass.GetSanitizationSGP125TDataById(lngId);
                try
                {
                    if (objML_SanitizationSGP125TData != null)
                    {
                        int obhReturn = objBusinessClass.UpdateUniqueSanitizationSGP125TData(objML_SanitizationSGP125TData);

                        if (obhReturn == 1)
                        {
                            lblMsg.Text = "Record Update Successfully";
                            //lblMsgEdit.Text = "Record Update Successfully";
                        }
                        else if (obhReturn == 2)
                        {
                            lblMsg.Text = "Record Already Exists!";
                            // lblMsgEdit.Text = "Record Already Exists!";
                        }
                        else
                        {
                            lblMsg.Text = "Ooops!OtherIssue...";
                            // lblMsgEdit.Text = "Ooops!OtherIssue...";
                        }
                        FillGrid();
                    }
                }
                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;
                }
            }
        }
Esempio n. 3
0
        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);
                }
            }
        }
        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);
                }
            }
        }
Esempio n. 5
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;
                }
            }
        }
 private void reloadData()
 {
     BusinessClass biz;
     biz = new BusinessClass();
     DataGrid1.DataSource = biz.GetData();
     DataGrid1.DataBind();
 }
 private void ReloadData()
 {
     BusinessClass bc = new BusinessClass();
     DataGrid1.DataSource = bc.GetData();
     DataGrid1.DataBind();
 }
 private void Page_Load(object sender, System.EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             BusinessClass bc = new BusinessClass();
             DataGrid1.DataSource = bc.GetData();
             DataGrid1.DataBind();
         }
         catch(InworxException et)
         {
             Response.Redirect("Error.aspx?msg=" + Server.UrlEncode(et.Message) + " - " + Server.UrlEncode(et.StackTrace));
         }
     }
 }
Esempio n. 9
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);
                }
            }
        }
 private void reloadData()
 {
     BusinessClass biz;
     try
     {
         biz = new BusinessClass();
         DataGrid1.DataSource = biz.GetData();
         DataGrid1.DataBind();
     }
     catch(InworxException ex)
     {
         Response.Redirect("error.aspx?msg=" + Server.UrlEncode(ex.Message));
     }
 }