Example #1
0
        void treeViewOperator_BeforeAdd(object render, ObjectOperationEventArgs<sd_xl> e) {
            if (ParentObj == null) {
                MsgBox.ShowTipMessageBox("请先选择供电所!");
                e.Cancel = true;

            }
        }
Example #2
0
        void gridViewOperation_BeforeInsert(object render, ObjectOperationEventArgs<BD_SBTZ> e)
        {
            e.Cancel = true;
            try
            {
                frmSBTZ frm = gridViewOperation.EditForm as frmSBTZ;
                PS_Image image = null;
                if (frm.GetImage() != null)
                {
                    image = new PS_Image();
                    image.ImageName = "变电设备照片";
                    image.ImageType = "sdsb";
                    image.ImageData = (byte[])frm.GetImage();
                    e.Value.c3 = image.ImageID;
                    Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(new object[] { e.Value, image }, null, null);
                }
                else
                {
                    Client.ClientHelper.PlatformSqlMap.Create<BD_SBTZ>(e.Value);
                }

                gridViewOperation.BindingList.Add(e.Value);
            }
            catch (Exception err) { throw err; }
        }
Example #3
0
        void gridViewOperation_BeforeUpdate(object render, ObjectOperationEventArgs<sd_tsqy> e) {
            //e.Cancel = true;
            //try
            //{
            //    sd_tsqy sdsb = e.Value;
            //    frmSBTZ frm = gridViewOperation.EditForm as frmSBTZ;
            //    PS_Image image = frm.GetPS_Image();
            //    if (frm.GetImage() != null)
            //    {
            //        if (sdsb.a25 == "" || image == null)
            //        {
            //            image = new PS_Image();
            //            image.ImageName = "特殊区域照片";
            //            image.ImageType = "sdsb";
            //            image.ImageData = (byte[])frm.GetImage();
            //            sdsb.a25 = image.ImageID;
            //            Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(image, sdsb, null);
            //        }
            //        else
            //        {

            //            Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(null, new object[] { sdsb, image }, null);
            //        }

            //    }
            //    else
            //    {
            //        Client.ClientHelper.PlatformSqlMap.Update<sd_tsqy>(e.Value);
            //    }

            //    Ebada.Core.ConvertHelper.CopyTo(sdsb, e.ValueOld);
            //}
            //catch (Exception err) { throw err; }
        }
Example #4
0
 void treeViewOperator_BeforeDelete(object render, ObjectOperationEventArgs<VOrgLevel> e) {
     //检查子表是否有相关联数据
     if (ChildView != null && childView.BindingList.Count > 0) {
         e.Cancel = true;
         MainHelper.ShowWarningMessageBox("当前要删除的记录已被引用,不可删除!");
     }
 }
Example #5
0
 void gridViewOperation_BeforeEdit(object render, ObjectOperationEventArgs<PS_XLSec> e)
 {
     if (parentID == null)
         e.Cancel = true;
     frmXLSecEdit frm = gridViewOperation.EditForm as frmXLSecEdit;
     frm.ParentObj = ParentObj;
 }
Example #6
0
 void gridViewOperation_BeforeAdd(object render, ObjectOperationEventArgs<PS_xl> e) {
     if (string.IsNullOrEmpty(parentID))
     {
         e.Cancel = true;
         MsgBox.ShowWarningMessageBox("请先选择机构后增加职员!");
     }
 }
Example #7
0
 void gridViewOperation_BeforEdit(object render, ObjectOperationEventArgs<sdjl_sbxsqd> e) {
     if (ParentID == null) {
         e.Cancel = true;
     }
     fdialog.orgcode = parentObj.OrgID;
     //fdialog.RowData = gridView1.GetRow(gridView1.FocusedRowHandle) as sdjl_sbxsqd;
 }
Example #8
0
 void gridViewOperation_BeforeAdd(object render, ObjectOperationEventArgs<Empolyees> e) {
     //判断是否有parentid值,如果没有不允许增加子表记录
     if (string.IsNullOrEmpty(parentID)) {
         e.Cancel = true;
         MainHelper.ShowWarningMessageBox("请先选择单位后增加职员!");
     }
 }
Example #9
0
        void gridViewOperation_BeforeDelete(object render, ObjectOperationEventArgs<mOrg> e) {
            if (ChildView != null && childView.BindingList.Count > 0) {
                e.Cancel = true;
                MainHelper.ShowWarningMessageBox("当前要删除的记录已被引用,不可删除!");
            }

        }
Example #10
0
 void gridViewOperation_BeforeUpdate(object render, ObjectOperationEventArgs<mUser> e)
 {
     if (e.Value.Password.Length <= 12)
     {
         e.Value.Password = MainHelper.EncryptoPassword(e.Value.Password);
     }
 }
Example #11
0
 void gridViewOperation_BeforeAdd(object render, ObjectOperationEventArgs<bdjl_ksjl> e)
 {
     if (parentID == null)
         e.Cancel = true;
     if (string.IsNullOrEmpty(baruser.EditValue as string))
         e.Cancel = true;
 }
Example #12
0
 void gridViewOperation_BeforeEdit(object render, ObjectOperationEventArgs<JH_yearks> e) {
     if (e.Value.计划分类 != type2 ||e.Value.单位分类 != type1) {
         e.Cancel = true;
         MsgBox.ShowAskMessageBox("此记录不能修改");
         return;
     }
 }
Example #13
0
 void gridViewOperation_BeforeUpdate(object render, ObjectOperationEventArgs<PS_XLSec> e)
 {
     e.Cancel = true;
     if (ParentObj==null)
     {
         return;
     }
     IList<PS_XLSec> xlSecList = (IList<PS_XLSec>)gridControl1.DataSource;
     if (xlSecList == null)
     {
         return;
     }
    // IList<PS_XLSec> xlSecList = Ebada.Core.ConvertHelper.ToIList<PS_XLSec>(dt);
     PS_XLSec xlSec = (gridViewOperation.EditForm as frmXLSecEdit).RowData as PS_XLSec;
     for (int i = 0; i < xlSecList.Count;i++ )
     {
         PS_XLSec xlSecTemp = xlSecList[i];
         if (xlSecTemp.ID==xlSec.ID)
         {
             xlSecList[i].StartGT = xlSec.StartGT;
             xlSecList[i].EndGT = xlSec.EndGT;
             xlSecList[i].LineType = xlSec.LineType;
         }
     }
     string strXLSec = ListCacheHelper.GetXLSecString(xlSecList);
     ParentObj.SectionalizedMessage = strXLSec;
     Client.ClientHelper.PlatformSqlMap.Update<PS_xl>(ParentObj);
     Refresh();
     return;
 }
Example #14
0
        void gridViewOperation_BeforeUpdate(object render, ObjectOperationEventArgs<PS_gt> e) {
            e.Cancel = true;
            try {
                PS_gt gt =e.Value;
                frmgtEdit frm = gridViewOperation.EditForm as frmgtEdit;
                PS_Image image = frm.GetPS_Image();
                if (frm.GetImage() != null ) {
                    if (gt.ImageID == "" || image==null) {
                        image = new PS_Image();
                        image.ImageName = "杆塔照片";
                        image.ImageType = "gt";
                        image.ImageData = (byte[])frm.GetImage();
                        gt.ImageID = image.ImageID;
                         Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(image, gt, null);
                    } else {

                        Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(null,new object[] { gt, image },  null);
                    }
                   
                } else {
                    Client.ClientHelper.PlatformSqlMap.Update<PS_gt>(e.Value);
                }

                Ebada.Core.ConvertHelper.CopyTo(gt, e.ValueOld);
            } catch (Exception err) { throw err; }
        }
Example #15
0
 void gridViewOperation_BeforeInsert(object render, ObjectOperationEventArgs<PS_tq> e) {
     int count = ClientHelper.PlatformSqlMap.GetRowCount<PS_tq>(string.Format("where tqcode='{0}' ", e.Value.tqCode));
     if (count > 0) {
         MsgBox.ShowWarningMessageBox("台区代码重复!");
         e.Cancel = true;
         return;
     }
 }
Example #16
0
      void gridViewOperation_BeforeAdd(object render, ObjectOperationEventArgs<E_Level> e) {
          if (ParentID==string.Empty)
          {
              MsgBox.ShowWarningMessageBox("请选添加季信息,然后再添加关卡信息!");
              e.Cancel = true;
          }
 
      }
Example #17
0
        void gridViewOperation_BeforeAdd(object render, ObjectOperationEventArgs<LP_Temple> e) {

            this.dsoFramerWordControl1.FileSave();
            rowData.DocContent = this.dsoFramerWordControl1.FileDataGzip;
            uCmExcel1.ParentObj = rowData;
            e.Value.DocContent = rowData.DocContent;

        }
Example #18
0
 void gridViewOperation_BeforeUpdate(object render, ObjectOperationEventArgs<PJ_24> e)
 {
     if (e.Value.BigData == null)
     {
         e.Value.BigData = new byte[0]; 
     }
 
 }
Example #19
0
 void gridViewOperation_BeforeAdd(object render, ObjectOperationEventArgs<PJ_22> e) {
     if (parentID == null)
         e.Cancel = true;
     e.Value.bxsj = DateTime.Now;
     e.Value.dsj = DateTime.Now;
     e.Value.wsj = DateTime.Now;
     e.Value.tdsj = DateTime.Now;
     e.Value.sdsj = DateTime.Now;
 }
Example #20
0
        void gridViewOperation_BeforeAdd(object render, ObjectOperationEventArgs<E_R_EBankPro> e) {
               if (ParentID==string.Empty||ParentID==null)
	        {
                   MsgBox.ShowWarningMessageBox("请选择题库!");
                   e.Cancel=true;
                   return;
	        }
               e.Value.EBID = ParentID;
        }
Example #21
0
 void gridViewOperation_BeforeInsert(object render, ObjectOperationEventArgs<BD_SBTZ_ZL> e)
 {
     BD_SBTZ_ZL sbzl = e.Value as BD_SBTZ_ZL;
     IList<BD_SBTZ_ZL> sbzlList= Client.ClientHelper.PlatformSqlMap.GetListByWhere<BD_SBTZ_ZL>("where dm='"+sbzl.dm+"'");
     if (sbzlList.Count > 0)
     {
         MessageBox.Show("种类代码重复,添加失败!");
         e.Cancel = true;
     }
 }
Example #22
0
 void gridViewOperation_BeforeInsert(object render, ObjectOperationEventArgs<sdjls_dgjcjl> e)
 {
     sdjls_dgjcjl dgjcjl = e.Value;
     IList<sdjls_dgjcjl> dgjcList = Client.ClientHelper.PlatformSqlMap.GetListByWhere<sdjls_dgjcjl>("where orgcode='" + dgjcjl.OrgCode + "' and linecode='" + dgjcjl.LineCode + "' and linevol='" + dgjcjl.LineVol + "'");
     if (dgjcList.Count > 0)
     {
         e.Cancel = true;
         return;
     }
 }
Example #23
0
        void gridViewOperation_BeforeDelete(object render, ObjectOperationEventArgs<E_LevelStop> e) {

            string sqlwhere = " where LevelID='" + ParentIDB + "'";
            int recordnum = MainHelper.PlatformSqlMap.GetRowCount<E_LevelStop>(sqlwhere);
            if (recordnum==10)
            {
                e.Cancel = true;
            }

        }
Example #24
0
 void gridViewOperation_BeforeInsert(object render, ObjectOperationEventArgs<sd_tsqyzl> e)
 {
     sd_tsqyzl sbzl = e.Value as sd_tsqyzl;
     IList<sd_tsqyzl> sbzlList= Client.ClientHelper.PlatformSqlMap.GetListByWhere<sd_tsqyzl>("where zldm='"+sbzl.zldm+"'");
     if (sbzlList.Count > 0)
     {
         MessageBox.Show("种类代码重复,添加失败!");
         e.Cancel = true;
     }
 }
 void treeViewOperator_BeforeEdit(object render, ObjectOperationEventArgs<LP_Temple> e)
 {
     if (treeList1.FocusedNode == null)
     {
         return;
     }
     LP_Temple lp = treeList1.GetDataRecordByNode(treeList1.FocusedNode) as LP_Temple;
     if (lp.CtrlSize == "目录")
     {
         e.Cancel=true;
     }
     
 }
Example #26
0
 void gridViewOperation_BeforeAdd(object render, ObjectOperationEventArgs<sdjl_07jdzz> e)
 {
     if (parentID == null)
     {
         MsgBox.ShowWarningMessageBox("请选择单位!");
         e.Cancel = true;
     }
     if (string.IsNullOrEmpty(barxl.EditValue as string))
     {
         MsgBox.ShowWarningMessageBox("请选择线路!");
         e.Cancel = true;
     }
 }
Example #27
0
 void gridViewOperation_BeforeDelete(object render, ObjectOperationEventArgs<bdjl_ksjl> e)
 {
     if (childView != null && childView.BindingList.Count > 0) e.Cancel = true;
     if (gridView1.GetFocusedRow() == null)
         return;
     bdjl_ksjl ksjl = gridView1.GetFocusedRow() as bdjl_ksjl;
     IList<bdjl_ksnr> ksnrList = new List<bdjl_ksnr>();
     ksnrList= Client.ClientHelper.PlatformSqlMap.GetListByWhere<bdjl_ksnr>("where ParentID='" + ksjl.ID + "'");
     if (ksnrList.Count > 0)
     {
         MsgBox.ShowWarningMessageBox("请先删除考试内容!");
         e.Cancel = true;
     }
 }
Example #28
0
        void gridViewOperation_BeforeUpdate(object render, ObjectOperationEventArgs<PS_tq> e) {
            if(e.Value.tqCode!=e.ValueOld.tqCode){
                int count = ClientHelper.PlatformSqlMap.GetRowCount<PS_tq>(string.Format("where tqcode='{0}' ", e.Value.tqCode));
                if (count > 0) {
                    MsgBox.ShowWarningMessageBox("台区代码重复!");
                    e.Cancel = true;
                    return;
                }

            }
            if (e.Value.Contractor != e.ValueOld.Contractor)
                Client.ClientHelper.PlatformSqlMap.Update("Update",
                    string.Format("update ps_xl set Contractor='{0}' where left(linecode,{1})='{2}'", e.Value.Contractor, e.Value.tqCode.Length, e.Value.tqCode));
        }
Example #29
0
        void gridViewOperation_BeforeAdd(object render, ObjectOperationEventArgs<PS_gtsbclb> e) {
            if (parentID == null)
                e.Cancel = true;
            IList<PS_gtsbclb> pnumli = Client.ClientHelper.PlatformSqlMap.GetListByWhere
                       <PS_gtsbclb>(" where  1=1 and xh='' order by  id desc ");
            
                if (pnumli.Count == 0)
                    e.Value.zlCode = string.Format("{0:D3}", 1);
                else
                {
                    e.Value.zlCode = (Convert.ToDecimal(pnumli[0].zlCode) + 1).ToString("000");

                }
            
        }
Example #30
0
        void treeViewOperator_BeforeInsert(object render, ObjectOperationEventArgs<mModule> e) {
            List<object> list = new List<object>();
            string parentid = e.Value.Modu_ID;
            list.Add(e.Value);
            list.Add(createFun("btAdd", "增加", parentid));
            list.Add(createFun("btEdit", "修改", parentid));
            list.Add(createFun("btDelete", "删除", parentid));
            list.Add(createFun("btFind", "查询", parentid));
            list.Add(createFun("btExport", "导出", parentid));
            
            Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(list, null, null);
            e.Cancel = true;

            treeViewOperator.BindingList.Add(e.Value);
        }