Ejemplo n.º 1
0
 private void btnEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     try
     {
         if (gvUser.FocusedRowHandle >= 0)
         {
             ObjUser                 = new User();
             ObjUser.USERID          = gvUser.GetFocusedRowCellValue("USERID");
             ObjUser.ROLEID          = gvUser.GetFocusedRowCellValue("ROLEID");
             ObjUser.REPORTINGLEADID = gvUser.GetFocusedRowCellValue("REPORTINGLEADID");
             ObjUser.CATEGORYID      = gvUser.GetFocusedRowCellValue("CATEGORYID");
             ObjUser.BRANCHID        = gvUser.GetFocusedRowCellValue("BRANCHID");
             ObjUser.USERNAME        = gvUser.GetFocusedRowCellValue("USERNAME");
             ObjUser.FULLNAME        = gvUser.GetFocusedRowCellValue("FULLNAME");
             ObjUser.CNUMBER         = gvUser.GetFocusedRowCellValue("CNUMBER");
             ObjUser.EMAIL           = gvUser.GetFocusedRowCellValue("EMAIL");
             ObjUser.GENDER          = gvUser.GetFocusedRowCellValue("GENDER");
             frmUser obj = new frmUser(ObjUser);
             obj.ShowInTaskbar        = false;
             obj.StartPosition        = FormStartPosition.CenterScreen;
             obj.IconOptions.ShowIcon = false;
             obj.ShowDialog();
             if (ObjUser.IsSave)
             {
                 gcUser.DataSource = objMasterRep.GetUser();
                 Utility.Setfocus(gvUser, "USERID", ObjUser.USERID);
             }
         }
     }
     catch (Exception ex)
     {
         ErrorMgmt.ShowError(ex);
         ErrorMgmt.Errorlog.Error(ex);
     }
 }
Ejemplo n.º 2
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            ObjUser = new User();
            frmUser obj = new frmUser(ObjUser);

            obj.ShowInTaskbar        = false;
            obj.StartPosition        = FormStartPosition.CenterScreen;
            obj.IconOptions.ShowIcon = false;
            obj.ShowDialog();
            if (ObjUser.IsSave)
            {
                gcUser.DataSource = objMasterRep.GetUser();
                Utility.Setfocus(gvUser, "USERID", ObjUser.USERID);
            }
        }