예제 #1
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(PJ_gdscrk newobj)
 {
     if (barGDS.EditValue == null || barGDS.EditValue.ToString().Trim() == "")
     {
         return;
     }
     newobj.OrgCode = barGDS.EditValue.ToString();
 }
예제 #2
0
        /// <summary>
        /// 一次一导出入库单
        /// </summary>
        /// <param name="orgCode"></param>
        /// <param name="jingbanren"></param>
        public void ExportOne(PJ_gdscrk obj)
        {
            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\供电所材料出入库明细.xls";
            ex.Open(fname);

            string orgname = (string)ClientHelper.PlatformSqlMap.GetObject("SelectOneStr", "select top 1 OrgName from mOrg where OrgCode='" + obj.OrgCode + "'");
            string suozhang = (string)ClientHelper.PlatformSqlMap.GetObject("SelectOneStr", "select top 1 UserName from mUser where OrgCode='" + obj.OrgCode + "' and PostName='所长'");
            string shengjibanzhang = (string)ClientHelper.PlatformSqlMap.GetObject("SelectOneStr", "select top 1 UserName from mUser where OrgCode='" + obj.OrgCode + "' and PostName='生技班长'");

            ex.SetCellValue(orgname, 3, 3);
            ex.SetCellValue(suozhang, 47, 4);
            ex.SetCellValue(shengjibanzhang, 47, 6);

            int row = 5;
            int col = 1;

            ex.SetCellValue((1).ToString(), row, col);

            if (obj.type == "出库")
            {
                ex.SetCellValue(obj.ckdate.ToString("yyyy年MM月dd日"), row, col + 1);
                ex.SetCellValue(obj.cksl, row, col + 6);
            }
            else
            {
                ex.SetCellValue(obj.indate.ToString("yyyy年MM月dd日"), row, col + 1);
                ex.SetCellValue(obj.wpsl, row, col + 5);
            }
            ex.SetCellValue(obj.wpmc, row, col + 2);
            ex.SetCellValue(obj.wpgg, row, col + 3);
            ex.SetCellValue(obj.wpdw, row, col + 4);
            ex.SetCellValue(obj.kcslcount, row, col + 7);

            ex.ShowExcel();
        }
예제 #3
0
        void gridViewOperation_AfterAdd(PJ_gdscrk newobj)
        {
            if (isWorkflowCall)
            {
                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                mrwt.ModleRecordID = newobj.ID;
                mrwt.RecordID = currRecord.ID;
                mrwt.WorkFlowId = WorkFlowData.Rows[0]["WorkFlowId"].ToString();
                mrwt.WorkFlowInsId = WorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                mrwt.WorkTaskId = WorkFlowData.Rows[0]["WorkTaskId"].ToString();
                mrwt.ModleTableName = newobj.GetType().ToString();
                mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                mrwt.CreatTime = DateTime.Now;
                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
            }

            GetWpmc();
        }
예제 #4
0
 void gridViewOperation_AfterDelete(PJ_gdscrk obj)
 {
     if (isWorkflowCall)
     {
         MainHelper.PlatformSqlMap.DeleteByWhere<WF_ModleRecordWorkTaskIns>(" where ModleRecordID='" + obj.ID + "' and RecordID='" + currRecord.ID + "'"
             + " and  WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "'"
             + " and  WorkFlowInsId='" + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "'"
             + " and  WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'"
             + " and  WorkTaskInsId='" + WorkFlowData.Rows[0]["WorkTaskInsId"].ToString() + "'");
     }
     RefreshData();
 }
예제 #5
0
        void gridViewOperation_AfterEdit(PJ_gdscrk obj)
        {

        }
예제 #6
0
        public void ExportOne(PJ_gdscrk obj)
        {
            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\供电所材料季度对账.xls";
            ex.Open(fname);

            string orgname = (string)ClientHelper.PlatformSqlMap.GetObject("SelectOneStr", "select top 1 OrgName from mOrg where OrgCode='" + obj.OrgCode + "'");

            ex.SetCellValue(orgname, 3, 2);

            int row = 5;
            int col = 1;
            ex.SetCellValue(obj.wpmc, row, col);
            ex.SetCellValue(obj.wpgg, row, col + 1);
            ex.SetCellValue(obj.wpdw, row, col + 2);
            ex.SetCellValue(obj.rkslcount, row, col + 3);
            ex.SetCellValue(obj.ckslcount, row, col + 4);
            ex.SetCellValue(obj.kcslcount, row, col + 5);
            ex.ShowExcel();
        }
예제 #7
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (lkeGDS.EditValue == null) return;

            frmGDSCKEdit frm = new frmGDSCKEdit();
            PJ_gdscrk wp = gridView1.GetFocusedRow() as PJ_gdscrk;

            if (wp == null || Convert.ToInt32(wp.kcsl) <= 0)
            {
                wp = new PJ_gdscrk();
            }
            IList<PJ_gdscrk> pnumli = Client.ClientHelper.PlatformSqlMap.GetListByWhere
            <PJ_gdscrk>(" where id like '%" + DateTime.Now.ToString("yyyyMMdd") + "%' order by id desc");
            if (pnumli.Count == 0)
                wp.num = "GDSCRK" + DateTime.Now.ToString("yyyyMMdd") + string.Format("{0:D4}", 1);
            else
            {
                wp.num = "GDSCRK" + (Convert.ToDecimal(pnumli[0].num.Replace("GDSCRK", "")) + 1);
            }
            wp.type = "出库";
            wp.OrgCode = lkeGDS.EditValue.ToString();
            frm.RowData = wp;
            frm.isSet = true;
            frm.ShowDialog();
        }