Esempio n. 1
0
 private void barExplorYear_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     frmNumSelect fys = new frmNumSelect();
     fys.strType = " and (type = '所安全工器具出库单' ) ";
     fys.StrSQL = "select distinct num  from PJ_anqgjcrkd where  (type = '所安全工器具出库单') ";
     if (fys.ShowDialog() == DialogResult.OK)
     {
         ExportAQGJSCKEdit etdjh = new ExportAQGJSCKEdit();
         etdjh.ExportExcelProjectCKD("", fys.strNum);
     }
 }
Esempio n. 2
0
        private void barCopy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
             frmNumSelect fys = new frmNumSelect();
            fys.strType = " and 1=1";
            fys.StrSQL = "select distinct dhht  from PJ_clrkysd where  1=1 and dhht!=''";
            if (fys.ShowDialog() == DialogResult.OK)
            {
                string filter = " where 1=1";
                if(fys.strNum!="全部")
                    filter = " where dhht='" + fys.strNum + "'";
                IList<PJ_clrkysd> datalist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_clrkysd>(
                         filter
                           );
                IList<PJ_clcrkd> cdatalist = new List<PJ_clcrkd>();
                string num = "";
                IList<PJ_clcrkd> pnumli = Client.ClientHelper.PlatformSqlMap.GetListByWhere
                   <PJ_clcrkd>(" where  id like '" + DateTime.Now.ToString("yyyyMMdd") + "%' and type='工程材料入库单' order by id desc ");
                if (pnumli.Count == 0)
                    num = "SCRK" + DateTime.Now.ToString("yyyyMMdd") + string.Format("{0:D4}", 1);
                else
                {
                    num = "SCRK" + (Convert.ToDecimal(pnumli[0].num.Replace("SCRK", "")) + 1);

                }
                PJ_clcrkd lc = null;
                foreach (PJ_clrkysd ysd in datalist)
                {
                    lc = MainHelper.PlatformSqlMap.GetOne<PJ_clcrkd>(" where lyparent='"+ysd.ID +"' and type = '工程材料入库单'");
                    if (lc == null)
                    {
                        PJ_clcrkd clc = new PJ_clcrkd();
                        clc.ID = clc.CreateID();
                        clc.ssgc = ysd.ssgc;
                        clc.ssxm = ysd.ssxm;
                        clc.type = "工程材料入库单";
                        clc.num = num;
                        clc.wpmc = ysd.wpmc;
                        clc.wpgg = ysd.wpgg;
                        clc.wpdw = ysd.wpdw;
                        clc.wpdj = ysd.wpdj;
                        clc.wpcj = ysd.ghdw;
                        clc.wpsl = ysd.wpsl;
                        clc.kcsl = ysd.wpsl;
                        clc.indate = ysd.indate;
                        clc.lyparent = ysd.ID;
                        cdatalist.Add(clc);

                        Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    }
                }
                frmCLRKYSShow fss = new frmCLRKYSShow();
                fss.DataList = cdatalist;
                if (fss.ShowDialog() == DialogResult.OK)
                {
                    foreach (PJ_clcrkd clc in cdatalist)
                    {
                        double i = 0;
                        System.Collections.IList mclist = ClientHelper.PlatformSqlMap.GetList("SelectOneInt",
                            "select  sum(cast(kcsl as float) )  from PJ_clcrkd where (type = '工程材料入库单' or type = '工程材料入库单原始库存')"
                            + " and wpmc='" + clc.wpmc + "' " + " and ssgc='" + clc.ssgc + "' "
                            + " and wpgg='" + clc.wpgg + "' and id!='" + clc.ID + "' ");
                        if (mclist[0] != null) i = Convert.ToDouble(mclist[0].ToString());
                        clc.zkcsl = (Convert.ToDouble(clc.kcsl) + i).ToString();
                        Client.ClientHelper.PlatformSqlMap.Create<PJ_clcrkd>(clc);
                    }
                    MsgBox.ShowTipMessageBox("导入成功!");
                }
            }
        }
Esempio n. 3
0
        private void SubmitButton_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmModleSubmit fm = new frmModleSubmit();
            fm.RecordWorkFlowData = WorkFlowData;
            fm.CurrRecord = currRecord;
            if (currRecord.Status == "申报")
                fm.Status = "add";
            else
                fm.Status = "edit";
            fm.Kind = currRecord.Kind;
            frmNumSelect fys = new frmNumSelect();
            fys.strType = " and (type = '所安全工器具出库单' ) ";
            fys.StrSQL = "select distinct ssgc  from PJ_anqgjcrkd where  (type = '所安全工器具出库单' ) ";
            if (fys.ShowDialog() == DialogResult.OK)
            {
                ExportAQGJSCKEdit export = new ExportAQGJSCKEdit();
                export.CurrRecord = currRecord;
                export.IsWorkflowCall = isWorkflowCall;
                export.ParentTemple = parentTemple;
                export.RecordWorkFlowData = WorkFlowData;

                export.ExportExcelSubmit(ref parentTemple, "", fys.strNum, false);

                fm.ParentTemple = parentTemple;
                if (fm.ShowDialog() == DialogResult.OK)
                {
                    if (fjly == null) fjly = new frmModleFjly();
                    fjly.btn_Submit_Click(sender, e);
                    if (MainHelper.UserOrg.OrgName.IndexOf("局") == -1)
                        export.ExportExceljhbAllSubmitToWF_ModleRecordWorkTaskIns("", fys.strNum);
                    else
                        export.ExportExceljhbAllSubmitToWF_ModleRecordWorkTaskIns("", fys.strNum);
                    gridControl1.FindForm().Close();
                }
            }
        }
Esempio n. 4
0
        private void btView_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            //IList<PJ_anqgjcrkd> datalist = gridView1.DataSource as IList<PJ_anqgjcrkd>;
            frmNumSelect fys = new frmNumSelect();
            fys.strType = " and (type = '局安全工器具入库单' or type = '局安全工器具入库单原始库存') ";
            fys.StrSQL = "select distinct num  from PJ_anqgjcrkd where  (type = '局安全工器具入库单' or type = '局安全工器具入库单原始库存') ";
            if (fys.ShowDialog() == DialogResult.OK)
            {

                ExportAQGJRKEdit etdjh = new ExportAQGJRKEdit();
                etdjh.ExportExcelProjectCKD(parentID,fys.strNum);
            }
           
           
           
        }