Ejemplo n.º 1
0
        void gridViewOperation_AfterDelete(PJ_wgclcrkd 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() + "'");
            }
            long i = 0;
            PJ_wgclcrkd pc = ClientHelper.PlatformSqlMap.GetOneByKey<PJ_wgclcrkd>(obj.lyparent);
            pc.kcsl = (Convert.ToDouble(pc.kcsl) + Convert.ToDouble(obj.cksl)).ToString();
            ClientHelper.PlatformSqlMap.Update<PJ_wgclcrkd>(pc);

            //IList mclist = ClientHelper.PlatformSqlMap.GetList("SelectOneInt",
            //    "select  sum(cast(kcsl as float) )  from PJ_wgclcrkd where (type = '工程材料入库单' or type = '工程材料入库单原始库存')"
            //    + " and wpmc='" + obj.wpmc + "' " + " and ssgc='" + obj.ssgc + "' "
            //    + " and wpgg='" + obj.wpgg + "'  ");

            //IList<PJ_wgclcrkd> datalist = ClientHelper.PlatformSqlMap.GetListByWhere<PJ_wgclcrkd>
            //        ("where (type = '工程材料出库单')"
            //    + " and wpmc='" + obj.wpmc + "' " + " and ssgc='" + obj.ssgc + "' "
            //    + " and wpgg='" + obj.wpgg + "'  order by id desc ");
            //if (datalist.Count > 0)
            //{
            //    if (mclist[0] != null) i = Convert.ToInt64(mclist[0].ToString());
            //    datalist[0].zkcsl = i.ToString();
            //    ClientHelper.PlatformSqlMap.Update<PJ_wgclcrkd>(datalist[0]);
            //}
            RefreshData(" where    type = '工程材料出库单' ");
        }
Ejemplo n.º 2
0
        void gridViewOperation_AfterEdit(PJ_wgclcrkd newobj)
        {


        }
Ejemplo n.º 3
0
        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            if (gridView1.FocusedRowHandle < -1)
                return;
            PJ_wgclcrkd rowdata = gridView1.GetFocusedRow() as PJ_wgclcrkd;
            rowdata = ClientHelper.PlatformSqlMap.GetOneByKey<PJ_wgclcrkd>(rowdata.ID);
            frmWGCJGCCLDSingleXZ frm = new frmWGCJGCCLDSingleXZ();
            frm.RowData = new PJ_wgclcrkd();
            ConvertHelper.CopyTo<PJ_wgclcrkd>(rowdata, (PJ_wgclcrkd)frm.RowData);
            ((PJ_wgclcrkd)frm.RowData).Remark = "";
            ((PJ_wgclcrkd)frm.RowData).yt = "工程";

            IList<PJ_wgclcrkd> pnumli = Client.ClientHelper.PlatformSqlMap.GetListByWhere
            <PJ_wgclcrkd>(" where  id like '" + DateTime.Now.ToString("yyyyMMdd") + "%' and type='" + comboBoxEdit6.Text + "' order by id desc ");
            if (pnumli.Count == 0)
                ((PJ_wgclcrkd)frm.RowData).num = "CJCLDCK" + DateTime.Now.ToString("yyyyMMdd") + string.Format("{0:D4}", 1);
            else
            {
                ((PJ_wgclcrkd)frm.RowData).num = "CJCLDCK" + (Convert.ToDecimal(pnumli[0].num.Replace("CJCLDCK","")) + 1);

            }
            ((PJ_wgclcrkd)frm.RowData).ckdate = DateTime.Now;
            double i = 0;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                PJ_wgclcrkd ckd = new PJ_wgclcrkd();
                ConvertHelper.CopyTo<PJ_wgclcrkd>(rowdata, ckd);
                ckd.ID = ckd.CreateID();
               
                System.Collections.IList mclist = ClientHelper.PlatformSqlMap.GetList("SelectOneInt",
                    "select  sum(cast(kcsl as float) )  from PJ_wgclcrkd where (type = '撤旧材料入库单' or type = '撤旧材料入库单原始库存')"
                    + " and wpmc='" + rowdata.wpmc + "' " + " and ssgc='" + rowdata.ssgc + "' "
                    + " and wpgg='" + rowdata.wpgg + "' ");
                if (mclist[0] != null) i = Convert.ToDouble(mclist[0].ToString());
                double cktemp = Convert.ToDouble(frm.ReturnData.cksl);
                double zkc = Convert.ToDouble(i);
                // i = Client.ClientHelper.PlatformSqlMap.GetRowCount
                //<PJ_wgclcrkd>(" where  id like '" + DateTime.Now.ToString("yyyyMMdd") + "%' and type='" + comboBoxEdit6.Text + "' ");
                ckd.num = frm.ReturnData.num;
                ckd.type = comboBoxEdit6.Text;
                ckd.Remark = frm.ReturnData.Remark;
                ckd.yt = frm.ReturnData.yt;
                ckd.ssxm = frm.ReturnData.ssxm;
                ckd.lqdw = frm.ReturnData.lqdw;
                ckd.ghdw = frm.ReturnData.ghdw;
                ckd.ckdate = frm.ReturnData.ckdate;
                if (cktemp >= Convert.ToDouble(rowdata.kcsl))
                {
                    ckd.cksl = rowdata.kcsl;
                    ckd.zkcsl = (zkc - Convert.ToDouble(rowdata.kcsl)).ToString();
                    cktemp = cktemp - Convert.ToDouble(rowdata.kcsl);
                    ckd.kcsl = "0";
                    rowdata.kcsl = "0";
                    ClientHelper.PlatformSqlMap.Update<PJ_wgclcrkd>(rowdata);
                }
                else
                {
                    ckd.cksl = cktemp.ToString();
                    ckd.zkcsl = (zkc - cktemp).ToString();
                    rowdata.kcsl = (Convert.ToDouble(rowdata.kcsl) - cktemp).ToString();
                    ckd.kcsl = rowdata.kcsl;
                    cktemp = 0;
                    ClientHelper.PlatformSqlMap.Update<PJ_wgclcrkd>(rowdata);
                }
                ckd.lyparent = rowdata.ID;
                zkc = Convert.ToDouble(ckd.zkcsl);
                Thread.Sleep(new TimeSpan(100000));//0.1毫秒

                if (isWorkflowCall)
                {

                    MainHelper.PlatformSqlMap.DeleteByWhere<WF_ModleRecordWorkTaskIns>(" where ModleRecordID='" + ckd.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() + "'");
                }
                ClientHelper.PlatformSqlMap.Create<PJ_wgclcrkd>(ckd);

                if (isWorkflowCall)
                {
                    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                    mrwt.ModleRecordID = ckd.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 = ckd.GetType().ToString();
                    mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                    mrwt.CreatTime = DateTime.Now;
                    MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                }

                ucgccld1.inidata();
            }
        }
Ejemplo n.º 4
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (returnData == null) returnData = new PJ_wgclcrkd();
     ConvertHelper.CopyTo<PJ_wgclcrkd>(rowData, returnData);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 新建对象设置Key值
        /// </summary>
        /// <param name="newobj"></param>
        void gridViewOperation_CreatingObjectEvent(PJ_wgclcrkd newobj)
        {

        }
Ejemplo n.º 6
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            frmWGCJCLCKXZ frm = new frmWGCJCLCKXZ();
            frm.strType = comboBoxEdit5.Text;
            if (clccktemp == null) clccktemp = new PJ_wgclcrkd();
            clccktemp.cksl = "0";
            clccktemp.yt = "工程";
            clccktemp.wpgg = ""; 
            //int i = Client.ClientHelper.PlatformSqlMap.GetRowCount
            //       <PJ_wgclcrkd>(" where  id like '" + DateTime.Now.ToString("yyyyMMdd") + "%' and type='" + comboBoxEdit6.Text + "' order by id desc  ");
            //frm.strNum = DateTime.Now.ToString("yyyyMMdd") + string.Format("{0:D4}", i + 1);
            
            IList<PJ_wgclcrkd> pnumli = Client.ClientHelper.PlatformSqlMap.GetListByWhere
                       <PJ_wgclcrkd>(" where  id like '" + DateTime.Now.ToString("yyyyMMdd") + "%' and type='" + comboBoxEdit6.Text + "'  order by id desc  ");
            if (clccktemp.num == "")
            {
                if (pnumli.Count == 0)
                    clccktemp.num = "CJCLDCK" + DateTime.Now.ToString("yyyyMMdd") + string.Format("{0:D4}", 1);
                else
                {
                    clccktemp.num = "CJCLDCK" + (Convert.ToDecimal(pnumli[0].num.Replace("CJCLDCK", "")) + 1);

                }
            }
            else
            {
                if (pnumli.Count > 0)
                {

                    if ((Convert.ToDecimal(clccktemp.num.Replace("CJCLDCK", ""))) - (Convert.ToDecimal(pnumli[0].num.Replace("CJCLDCK", ""))) > 1)
                    {
                        clccktemp.num = "CJCLDCK" + (Convert.ToDecimal(pnumli[0].num.Replace("CJCLDCK", "") + 1));
                    }
                }
            }
            frm.strNum = clccktemp.num;
            frm.RowData = new PJ_wgclcrkd();
            ((PJ_wgclcrkd)frm.RowData).ckdate = DateTime.Now;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                string ssgc = " and 1=1 ",  wpgg = " and 1=1 ", wpmc = " and 1=1 ";
                double isum = 0;
                    ssgc = " and ssgc='" + frm.ReturnData.ssgc  + "' ";

                    wpmc = " and wpmc='" + frm.ReturnData.wpmc  + "' ";

                    wpgg = " and wpgg='" + frm.ReturnData.wpgg  + "' ";
                    isum =Convert.ToDouble( frm.ReturnData.cksl);
                  string   strsql = " where  (type = '" + comboBoxEdit5.Text
                    + "' or type = '" + comboBoxEdit5.Text + "原始库存') "
                    + ssgc + wpmc + wpgg + " and cast(kcsl as float)>0 order by cast( indate as datetime) ";
                IList<PJ_wgclcrkd> datalist = ClientHelper.PlatformSqlMap.GetListByWhere<PJ_wgclcrkd>
                    (strsql);
                double cktemp = isum;
                double zkc = Convert.ToDouble(frm.ReturnData.zkcsl);
                IList<PJ_wgclcrkd> ckdatalist = new List<PJ_wgclcrkd>();
                decimal num = 0;
                 pnumli = Client.ClientHelper.PlatformSqlMap.GetListByWhere
                               <PJ_wgclcrkd>(" where  id like '" + DateTime.Now.ToString("yyyyMMdd") + "%' and type='" + comboBoxEdit6.Text + "'  order by id desc  ");
                    if (pnumli.Count == 0)
                        num = Convert.ToDecimal(DateTime.Now.ToString("yyyyMMdd") + string.Format("{0:D4}", 0));
                    else
                    {
                        num =  (Convert.ToDecimal(pnumli[0].num.Replace("CJCLDCK", "")));

                    }
                
                foreach (PJ_wgclcrkd pc in datalist)
                {
                    PJ_wgclcrkd ckd = new PJ_wgclcrkd();
                    ConvertHelper.CopyTo<PJ_wgclcrkd>(pc, ckd);
                    ckd.ID = ckd.CreateID();
                    //int i = Client.ClientHelper.PlatformSqlMap.GetRowCount
                    //       <PJ_wgclcrkd>(" where  id like '" + DateTime.Now.ToString("yyyyMMdd") + "%' and type='" + comboBoxEdit6.Text + "' order by id desc  ");
                    //frm.strNum = DateTime.Now.ToString("yyyyMMdd") + string.Format("{0:D4}", i + 1);

                    //ckd.num = "CJCLDCK" + (num + 1);
                    ckd.num = clccktemp.num;
                    ckd.type = comboBoxEdit6.Text;
                    ckd.Remark = frm.ReturnData.Remark;
                    ckd.yt = frm.ReturnData.yt;
                    ckd.ssxm = pc.ssxm;
                    ckd.lqdw = frm.ReturnData.lqdw;
                    ckd.ghdw= frm.ReturnData.ghdw;
                    ckd.ckdate = frm.ReturnData.ckdate;
                    if (cktemp >= Convert.ToDouble(pc.kcsl))
                    {
                        ckd.cksl = pc.kcsl;
                        ckd.zkcsl = (zkc - Convert.ToDouble(pc.kcsl)).ToString();
                        cktemp = cktemp - Convert.ToDouble(pc.kcsl);
                        pc.kcsl = "0";
                        //ClientHelper.PlatformSqlMap.Update<PJ_wgclcrkd>(pc);
                    }
                    else
                    {
                        ckd.cksl = cktemp.ToString();
                        ckd.zkcsl = (zkc - cktemp).ToString();

                        pc.kcsl = (Convert.ToDouble(pc.kcsl) - cktemp).ToString();
                        cktemp = 0;
                        //ClientHelper.PlatformSqlMap.Update<PJ_wgclcrkd>(pc);
                    }
                    ckd.lyparent = pc.ID;
                    zkc = Convert.ToDouble(ckd.zkcsl);
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    
                    //ClientHelper.PlatformSqlMap.Create<PJ_wgclcrkd>(CLDCKd);

                    ckdatalist.Add(ckd);
                    if (cktemp<1) break;
                    //num=(num + 1);
                }
                frmWGCJGCCLDShow frmshow = new frmWGCJGCCLDShow();
                frmshow.DataList = ckdatalist;
                if (frmshow.ShowDialog() == DialogResult.OK)
                {
                    cktemp = isum;
                    zkc = Convert.ToDouble(frm.ReturnData.zkcsl);
                    pnumli = Client.ClientHelper.PlatformSqlMap.GetListByWhere
                       <PJ_wgclcrkd>(" where  id like '" + DateTime.Now.ToString("yyyyMMdd") + "%' and type='" + comboBoxEdit6.Text + "' ");
                    if (pnumli.Count == 0)
                        num = Convert.ToDecimal(DateTime.Now.ToString("yyyyMMdd") + string.Format("{0:D4}", 0));
                    else
                    {
                        num =  (Convert.ToDecimal(pnumli[0].num.Replace("CJCLDCK", "")));

                    } 
                    datalist = ClientHelper.PlatformSqlMap.GetListByWhere<PJ_wgclcrkd>
                     (strsql);
                    foreach (PJ_wgclcrkd pc in datalist)
                    {
                        PJ_wgclcrkd ckd = new PJ_wgclcrkd();
                        ConvertHelper.CopyTo<PJ_wgclcrkd>(pc, ckd);
                        ckd.ID = ckd.CreateID();
                        //ckd.num = "CJCLDCK" + (num + 1);
                        ckd.num = clccktemp.num;
                        ckd.type = comboBoxEdit6.Text;
                        ckd.Remark = frm.ReturnData.Remark;
                        ckd.lqdw = frm.ReturnData.lqdw;
                        ckd.ghdw = frm.ReturnData.ghdw;
                        ckd.yt = frm.ReturnData.yt;
                        ckd.ssxm = frm.ReturnData.ssxm;
                        ckd.ckdate = frm.ReturnData.ckdate;
                        if (cktemp >= Convert.ToDouble(pc.kcsl))
                        {
                            ckd.cksl = pc.kcsl;
                            ckd.zkcsl = (zkc - Convert.ToDouble(pc.kcsl)).ToString();
                            cktemp = cktemp - Convert.ToDouble(pc.kcsl);
                            pc.kcsl = "0";
                            ClientHelper.PlatformSqlMap.Update<PJ_wgclcrkd>(pc);
                        }
                        else
                        {
                            ckd.cksl = cktemp.ToString();
                            ckd.zkcsl = (zkc - cktemp).ToString();

                            pc.kcsl = (Convert.ToDouble(pc.kcsl) - cktemp).ToString();
                            cktemp = 0;
                            ClientHelper.PlatformSqlMap.Update<PJ_wgclcrkd>(pc);
                        }
                        ckd.lyparent = pc.ID;
                        zkc = Convert.ToDouble(ckd.zkcsl);
                        Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                        if (isWorkflowCall)
                        {

                            MainHelper.PlatformSqlMap.DeleteByWhere<WF_ModleRecordWorkTaskIns>(" where ModleRecordID='" + ckd.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() + "'");
                        }
                        ClientHelper.PlatformSqlMap.Create<PJ_wgclcrkd>(ckd);


                        if (isWorkflowCall)
                        {
                            WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                            mrwt.ModleRecordID = ckd.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 = ckd.GetType().ToString();
                            mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                            mrwt.CreatTime = DateTime.Now;
                            MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                        }


                        if (cktemp < 1) break;
                        //num = (num + 1);

                    }
                    ucgccld1.inidata();
                    simpleButton1_Click(sender, e);
                }
            }
        }
Ejemplo n.º 7
0
        private void btAddKuCun_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            PJ_wgclcrkd cl = new PJ_wgclcrkd();
            bool isadd = false;

            cl = gridView1.GetFocusedRow() as PJ_wgclcrkd;
            if (cl == null || cl.type != "工程材料入库单原始库存")
            {
                cl = new PJ_wgclcrkd();
                //cl.OrgCode = parentObj.OrgCode;
                //cl.OrgName = parentObj.OrgName;
                cl.type = "工程材料入库单原始库存";
                cl.Remark = "工程材料入库单原始库存";
                isadd = true;
            }
            if (cl.type == "工程材料入库单原始库存")
            {
                frmWGCLRKEdit frm = new frmWGCLRKEdit();
                frm.RowData = cl;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    if (isadd)
                    {
                        MainHelper.PlatformSqlMap.Create<PJ_wgclcrkd>(cl);
                    }
                    else
                    {
                        MainHelper.PlatformSqlMap.Update<PJ_wgclcrkd>(cl);
                    }
                    RefreshData(" where     (type = '工程材料入库单' or type = '工程材料入库单原始库存') ");
                }
            }
            else
                return;

        }
Ejemplo n.º 8
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     
     if (comboBoxEdit3.Text == "0" || spinEdit2.Value == 0)
     {
         MsgBox.ShowTipMessageBox("物品无库存或出库数量为空!");
         return;
     }
     this.DialogResult = DialogResult.OK;
     rowData.zkcsl = spinEdit2.Properties.MaxValue.ToString();
     if (returnData == null) returnData = new PJ_wgclcrkd();
     ConvertHelper.CopyTo<PJ_wgclcrkd>(rowData, returnData);
 }
Ejemplo n.º 9
0
        void gridViewOperation_AfterEdit(PJ_wgclcrkd obj)
        {

            RefreshData(" where     (type = '工程材料入库单' or type = '工程材料入库单原始库存') ");
        }
Ejemplo n.º 10
0
        void gridViewOperation_AfterDelete(PJ_wgclcrkd 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() + "'");
            }

            long i = 0;
            System.Collections.IList mclist = ClientHelper.PlatformSqlMap.GetList("SelectOneInt",
                "select  sum(cast(kcsl as float) )  from PJ_wgclcrkd where (type = '工程材料入库单' or type = '工程材料入库单原始库存')"
                + " and wpmc='" + obj.wpmc + "' " + " and ssgc='" + obj.ssgc + "' "
                + " and wpgg='" + obj.wpgg + "' and id!='" + obj.ID + "' ");
            IList<PJ_wgclcrkd> datalist = ClientHelper.PlatformSqlMap.GetListByWhere<PJ_wgclcrkd>
                    ("where (type = '工程材料入库单' or type = '工程材料入库单原始库存')"
                + " and wpmc='" + obj.wpmc + "' " + " and ssgc='" + obj.ssgc + "' "
                + " and wpgg='" + obj.wpgg + "' and id!='" + obj.ID + "' order by id desc ");
            if (datalist.Count > 0)
            {
                if (mclist[0] != null) i = Convert.ToInt64(mclist[0].ToString());
                datalist[0].zkcsl = i.ToString();
                ClientHelper.PlatformSqlMap.Update<PJ_wgclcrkd>(datalist[0]);
            }
            RefreshData(" where OrgCode='" + parentID + "'   and (type = '工程材料入库单' or type = '工程材料入库单原始库存') ");
        }
Ejemplo n.º 11
0
        private void barExplorYear_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

            if (gridtable == null) return;
           
            IList<PJ_wgclcrkd> datalist = new List<PJ_wgclcrkd>();
            foreach (DataRow dr in gridtable.Rows)
            {
                PJ_wgclcrkd pc = new PJ_wgclcrkd();
                foreach (DataColumn dc in gridtable.Columns)
                {
                    if (dc.ColumnName.IndexOf("wpjz") < 0 && dc.ColumnName.IndexOf("xh") < 0 && dr[dc.ColumnName].ToString() != string.Empty)
                        pc.GetType().GetProperty(dc.ColumnName).SetValue(pc, dr[dc.ColumnName], null);
                }
                datalist.Add(pc);
            }
            //fys.strType = " and (type = '工程材料入库单' or type = '工程材料入库单原始库存') ";
            //fys.StrSQL = "select distinct ssgc  from PJ_wgclcrkd where  (type = '工程材料入库单' or type = '工程材料入库单原始库存') ";
            //if (fys.ShowDialog() == DialogResult.OK)
            //{

            ExportWGSCTZEdit etdjh = new ExportWGSCTZEdit();
            etdjh.ExportExcel(datalist);
            //}
        }
Ejemplo n.º 12
0
        private void btView_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            //IList<PJ_wgclcrkd> datalist = gridView1.DataSource as IList<PJ_wgclcrkd>;
            if (gridtable == null) return;
            IList<PJ_wgclcrkd> datalist = new List<PJ_wgclcrkd>();
            foreach (DataRow dr in gridtable.Rows)
            {
                PJ_wgclcrkd pc = new PJ_wgclcrkd();
                foreach (DataColumn dc in gridtable.Columns)
                {
                    if (dc.DataType.FullName.IndexOf("wpjz") < 0)
                        pc.GetType().GetProperty(dc.ColumnName).SetValue(pc, dr[dc.ColumnName], null);
                }
                datalist.Add(pc);
            }
            frmProjectSelect fys = new frmProjectSelect();
            //fys.strType = " and (type = '工程材料入库单' or type = '工程材料入库单原始库存') ";
            //fys.StrSQL = "select distinct ssgc  from PJ_wgclcrkd where  (type = '工程材料入库单' or type = '工程材料入库单原始库存') ";
            //if (fys.ShowDialog() == DialogResult.OK)
            //{

                ExportWGSCTZEdit etdjh = new ExportWGSCTZEdit();
                etdjh.ExportExcel(datalist);
            //}
           
           
           
        }
Ejemplo n.º 13
0
        void gridViewOperation_AfterDelete(PJ_wgclcrkd 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(" where OrgCode='" + parentID + "' ");
        }
Ejemplo n.º 14
0
 void gridViewOperation_AfterAdd(PJ_wgclcrkd 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);
     }
    
 }
Ejemplo n.º 15
0
        void gridViewOperation_AfterAdd(PJ_wgclcrkd obj)
        {

        }
Ejemplo n.º 16
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(PJ_wgclcrkd newobj)
 {
     if (parentID == null) return;
     newobj.OrgCode = parentID;
     newobj.OrgName = parentObj.OrgName;
     newobj.indate = DateTime.Now;
     try { frmLP.ReadTaskData(newobj, RecordWorkFlowData, ParentTemple, CurrRecord); } catch { }
 }
Ejemplo n.º 17
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_wgclrkysd 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_wgclrkysd> datalist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_wgclrkysd>(
                         filter
                           );
                IList<PJ_wgclcrkd> cdatalist = new List<PJ_wgclcrkd>();
                string num = "";
                IList<PJ_wgclcrkd> pnumli = Client.ClientHelper.PlatformSqlMap.GetListByWhere
                   <PJ_wgclcrkd>(" 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_wgclcrkd lc = null;
                foreach (PJ_wgclrkysd ysd in datalist)
                {
                    lc = MainHelper.PlatformSqlMap.GetOne<PJ_wgclcrkd>(" where lyparent='"+ysd.ID +"' and type = '工程材料入库单'");
                    if (lc == null)
                    {
                        PJ_wgclcrkd clc = new PJ_wgclcrkd();
                        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毫秒
                    }
                }
                frmWGCLRKYSShow fss = new frmWGCLRKYSShow();
                fss.DataList = cdatalist;
                if (fss.ShowDialog() == DialogResult.OK)
                {
                    foreach (PJ_wgclcrkd clc in cdatalist)
                    {
                        double i = 0;
                        System.Collections.IList mclist = ClientHelper.PlatformSqlMap.GetList("SelectOneInt",
                            "select  sum(cast(kcsl as float) )  from PJ_wgclcrkd 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_wgclcrkd>(clc);
                    }
                    MsgBox.ShowTipMessageBox("导入成功!");
                }
            }
        }