Exemple #1
0
 protected void btnCokeSupplierEditCancelPopup_Click(object sender, EventArgs e)
 {
     ModalPopupExtenderEdit.Hide();
 }
Exemple #2
0
 protected void btnUserTypeEditCancelPopup_Click(object sender, EventArgs e)
 {
     ModalPopupExtenderEdit.Hide();
 }
Exemple #3
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);
                }
            }
        }