private void btnEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     try
     {
         if (gvBranch.FocusedRowHandle >= 0)
         {
             ObjBranch              = new Branch();
             ObjBranch.BRANCHID     = gvBranch.GetFocusedRowCellValue("BRANCHID");
             ObjBranch.BRANCHNAME   = gvBranch.GetFocusedRowCellValue("BRANCHNAME");
             ObjBranch.BRANCHCODE   = gvBranch.GetFocusedRowCellValue("BRANCHCODE");
             ObjBranch.ADDRESS      = gvBranch.GetFocusedRowCellValue("ADDRESS");
             ObjBranch.STATEID      = gvBranch.GetFocusedRowCellValue("STATEID");
             ObjBranch.PHONENO      = gvBranch.GetFocusedRowCellValue("PHONENO");
             ObjBranch.EMAILID      = gvBranch.GetFocusedRowCellValue("EMAILID");
             ObjBranch.ISWAREHOUSE  = gvBranch.GetFocusedRowCellValue("ISWAREHOUSE");
             ObjBranch.LANDLINE     = gvBranch.GetFocusedRowCellValue("LANDLINE");
             ObjBranch.SUPERVISERID = gvBranch.GetFocusedRowCellValue("SUPERVISORID");
             frmBranch obj = new frmBranch(ObjBranch);
             obj.ShowInTaskbar        = false;
             obj.StartPosition        = FormStartPosition.CenterScreen;
             obj.IconOptions.ShowIcon = false;
             obj.ShowDialog();
             if (ObjBranch.IsSave)
             {
                 gcBranch.DataSource = objMasterRep.GetBranch();
                 Utility.Setfocus(gvBranch, "BRANCHID", ObjBranch.BRANCHID);
             }
         }
     }
     catch (Exception ex) {
         ErrorMgmt.ShowError(ex);
         ErrorMgmt.Errorlog.Error(ex);
     }
 }
        private void btnNew_Click(object sender, EventArgs e)
        {
            ObjBranch = new Branch();
            frmBranch obj = new frmBranch(ObjBranch);

            obj.ShowInTaskbar        = false;
            obj.StartPosition        = FormStartPosition.CenterScreen;
            obj.IconOptions.ShowIcon = false;
            obj.ShowDialog();
            if (ObjBranch.IsSave)
            {
                gcBranch.DataSource = objMasterRep.GetBranch();
                Utility.Setfocus(gvBranch, "BRANCHID", ObjBranch.BRANCHID);
            }
        }