コード例 #1
0
 protected void grdUserName_RowEditing(object sender, GridViewEditEventArgs e)
 {
     try
     {
         lblMsg.Text        = string.Empty;
         lblMsgEdit.Text    = string.Empty;
         lblMsg.Visible     = false;
         lblMsgEdit.Visible = false;
         int lngId = ML_Common.string2int32(grdUserName.DataKeys[e.NewEditIndex].Values[0].ToString());
         if (lngId > 0)
         {
             ViewState["grdUserNameEditId"] = lngId;
             grdUserName.EditIndex          = -1;
             e.Cancel = true;
             FormFieldsClear();
             FillObjectToForm(lngId, true);
             UpdatePanelEdit.Update();
             ModalPopupExtenderEdit.Show();
         }
         else
         {
             lblMsg.Visible = true;
             lblMsg.Text    = "Record is not exists?";
         }
     }
     catch (Exception ex)
     {
         Exception exc = ex;
     }
 }
コード例 #2
0
 protected void grdCokeSupplier_RowEditing(object sender, GridViewEditEventArgs e)
 {
     try
     {
         lblMsg.Text    = string.Empty;
         lblMsg.Visible = false;
         //grdCokeSupplier.EditIndex = -1;
         //grdCokeSupplier.EditIndex = e.NewEditIndex;
         // Guid  guid = ML_Common.String2Guid(grdCokeSupplier.DataKeys[e.NewEditIndex].Values[0].ToString());
         //int lngId = ML_Common.string2int(grdCokeSupplier.DataKeys[e.NewEditIndex].Values[0].ToString());
         int lngId = ML_Common.string2int32(grdCokeSupplier.DataKeys[e.NewEditIndex].Values[0].ToString());
         if (lngId > 0)
         {
             ViewState["grdCokeSupplierId"] = lngId;
             grdCokeSupplier.EditIndex      = -1;
             e.Cancel = true;
             FormFieldsClear();
             FillObjectToForm(lngId, true);
             UpdatePanelEdit.Update();
             ModalPopupExtenderEdit.Show();
         }
         else
         {
             lblMsg.Text    = "Record is not exists?";
             lblMsg.Visible = true;
         }
     }
     catch (Exception ex)
     {
         Exception exc = ex;// LogManager.LogManager.WriteErrorLog(ex);
     }
 }
コード例 #3
0
        private void GetAttatchFiles()
        {
            var    biz      = new BLL.PersonBiz();
            string personID = this.PersonID;

            DTO.ResponseService <DTO.PersonAttatchFile[]> res = biz.GetAttatchFileEditByPersonId(personID);

            var list = res.DataResponse.ToList();

            this.AttachFiles = list;
            ucAttachFileControl1.AttachFiles = this.AttachFiles.OrderBy(a => a.ATTACH_FILE_TYPE).ToList().ConvertToAttachFilesView();

            UpdatePanelEdit.Update();
        }
コード例 #4
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;
                }
            }
        }