Ejemplo n.º 1
0
 private void InitValue(LCKA lcka, int index, BaseIList baseIList)
 {
     if (index == 1)
     {
         lblDanh.txt.Text = baseIList.dingdanhao;
         // lblYWY.cobodgv.Text = baseIList.item0;
         // lblCW.cobodgv.Text = baseIList.item1;
         lblPIH.txt.Text      = baseIList.item2;
         lblBZ1.txt.Text      = baseIList.item3;
         lblTxt1.cobodgv.Text = baseIList.pingmin;
         lblTxt2.cobodgv.Text = baseIList.seming;
         lblZPS.cobodgv.Text  = baseIList.sehao;
         lblPS.txt.Text       = baseIList.pishu;
         lblZZ.txt.Text       = baseIList.zongliang;
         lblKH.cobodgv.Text   = baseIList.kehu;
         riqi.Value           = baseIList.riqi;
     }
     else
     {
         riqi.Value = DateTime.Now;
         //lblDanh.txt.Text = lcka.dingdanhao;
         //lblYWY.cobodgv.Text = lcka.item0;
         //lblCW.cobodgv.Text = lcka.item1;
         //lblPIH.txt.Text = lcka.item2;
         //lblBZ1.txt.Text = lcka.item3;
         lblTxt1.cobodgv.Text = lcka.peiming;
         lblTxt2.cobodgv.Text = lcka.sebie;
         lblZPS.cobodgv.Text  = lcka.sehao;
         lblPS.txt.Text       = lcka.peishu;
         lblZZ.txt.Text       = lcka.zhongliang;
         lblKH.cobodgv.Text   = lcka.kehu;
         //lblPS.txt.Text = lcka.;
     }
 }
Ejemplo n.º 2
0
        private bool Save()
        {
            //else
            {
                BaseIList baseIList = new BaseIList()
                {
                    riqi       = DateTime.Now,
                    kehu       = lblKH.cobodgv.Text,
                    dingdanhao = lblRKDH.txt.Text,
                    pingmin    = lblPM.cobodgv.Text,

                    item2  = lblLYGS.txt.Text,
                    item0  = lblRHLB.cobodgv.Text,
                    item3  = lblBZ1.txt.Text,
                    item1  = lblDYY.cobodgv.Text,
                    leibie = LieBie,
                };
                try
                {
                    db.Insertable <BaseIList>(baseIList).ExecuteCommand();
                    return(true);
                }catch (Exception ex)
                {
                    MessageBoxEx.Show(ex.Message, "提示");
                    return(false);
                }
            }
        }
Ejemplo n.º 3
0
 private void Save()
 {
     try
     {
         BaseIList baseIList = new BaseIList()
         {
             item0  = lblRLMC.cobodgv.Text,
             item1  = lblDJ.txt.Text,
             item2  = lblGHS.txt.Text,
             item3  = lblBZ.txt.Text,
             riqi   = dateTimePicker1.Value,
             leibie = "染料入库",
         };
         db.Insertable <BaseIList>(baseIList).ExecuteCommand();
         if (MessageBoxEx.Show(this, "保存成功是否退出编辑?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.No)
         {
             EditMode = false;
         }
         RF();
     }
     catch (Exception ex)
     {
         MessageBoxEx.Show(ex.Message, "提示");
     }
 }
Ejemplo n.º 4
0
        private bool Insert()
        {
            bool flag = false;

            if (!YanZheng())
            {
                return(flag);
            }
            try
            {
                var insertObj = new BaseIList()
                {
                    leibie = YanSe,
                    item0  = lblSHLB.cobodgv.Text,
                    item1  = lblPM.cobodgv.Text,
                    item2  = lblKH.cobodgv.Text,
                    item3  = lblSH.txt.Text,
                    menfu  = lblBH.txt.Text,
                    seming = lblSM.cobodgv.Text,
                    riqi   = DateTime.Now,
                };
                var t2 = db.Insertable <BaseIList>(insertObj).ExecuteReturnIdentity();
                if (t2 > 0)
                {
                    flag = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(flag);
        }
Ejemplo n.º 5
0
        private void RLdata(List <BaseIList> asdf)
        {
            dgvEX1.Rows.Clear();
            //if (asdf == null || baseIList == null) return;
            for (var i = 0; i < asdf.Count; i++)
            {
                BaseIList baseIList = asdf[i];

                int index = dgvEX1.Rows.Add();
                dgvEX1.Rows[index].Tag            = baseIList.SN;
                dgvEX1.Rows[index].Cells[0].Value = baseIList.dingdanhao;
                dgvEX1.Rows[index].Cells[1].Value = baseIList.kehu;
                dgvEX1.Rows[index].Cells[2].Value = baseIList.pingmin;
                dgvEX1.Rows[index].Cells[3].Value = baseIList.seming;
                dgvEX1.Rows[index].Cells[4].Value = baseIList.sehao;
                dgvEX1.Rows[index].Cells[5].Value = baseIList.pishu;
                dgvEX1.Rows[index].Cells[6].Value = baseIList.zongliang;

                dgvEX1.Rows[index].Cells[7].Value  = baseIList.item0;
                dgvEX1.Rows[index].Cells[8].Value  = baseIList.item1;
                dgvEX1.Rows[index].Cells[9].Value  = baseIList.item2;
                dgvEX1.Rows[index].Cells[10].Value = baseIList.riqi;
                dgvEX1.Rows[index].Cells[11].Value = baseIList.item3;
            }
            dgvEX1.HeJi();
        }
Ejemplo n.º 6
0
        private bool Save()
        {
            bool flag = false;

            try
            {
                var all = db.Queryable <LCKA>().Where(it => it.liushuihao == lblDanh.txt.Text).First();
                if (all == null)
                {
                    MessageBoxEx.Show("这没有发现此缸号重新选择");
                    return(flag);
                }
                var all1 = db.Queryable <BaseIList>().Where(it => it.dingdanhao == lblDanh.txt.Text && it.leibie == LEIBIE && it.item1 == lblCW.cobodgv.Text).First();
                if (all1 != null)
                {
                    MessageBoxEx.Show("该工序已返修");
                    return(flag);
                }
                var sd = new BaseIList()
                {
                    dingdanhao = lblDanh.txt.Text,
                    pingmin    = lblTxt1.txt.Text,
                    seming     = lblTxt2.txt.Text,
                    sehao      = lblZPS.txt.Text,
                    item0      = lblYWY.cobodgv.Text,
                    pishu      = lblPS.txt.Text,
                    item1      = lblCW.cobodgv.Text,
                    zongliang  = lblZZ.txt.Text,
                    item2      = lblPIH.txt.Text,
                    item3      = lblBZ1.txt.Text,
                    leibie     = LEIBIE,
                    kehu       = lblKH.cobodgv.Text,

                    /*
                     * SNka = all.SN,
                     * leibie = LEIBIE,
                     * item0 = lblYWY.cobodgv.Text,
                     * item1 = lblCW.cobodgv.Text,
                     * item2 = lblPIH.txt.Text,
                     * item3 = lblBZ1.txt.Text,
                     */
                    riqi = riqi.Value,
                };
                db.Insertable <BaseIList>(sd).ExecuteCommand();
                flag = true;
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message);
                flag = false;
            }
            return(flag);
        }
Ejemplo n.º 7
0
 private void InitValue(LCKA asdf, int index, BaseIList baseIList)
 {
     if (index == 1)
     {
         lblDanh.txt.Text = asdf.liushuihao;
         lblPIH.txt.Text  = baseIList.item0;
         lblBZ1.txt.Text  = baseIList.item3;
     }
     riqi.Value           = DateTime.Now;
     lblTxt1.cobodgv.Text = asdf.peiming;
     lblTxt2.cobodgv.Text = asdf.sebie;
     lblZPS.cobodgv.Text  = asdf.sehao;
     lblPS.txt.Text       = asdf.peishu;
     lblZZ.txt.Text       = asdf.zhongliang;
 }
Ejemplo n.º 8
0
        private bool Save()
        {
            if (lblLYDH.txt.Text.Length == 0)
            {
                MessageBoxEx.Show("请选择领用胚布", "提示");
                return(false);
            }
            var all1 = db.Queryable <BaseIList>()
                       .Where(it => it.dingdanhao == lblLYDH.txt.Text)
                       .OrderBy(it => it.SN, OrderByType.Desc)
                       .First();

            if (all1 == null)
            {
                MessageBoxEx.Show("没有发现此该胚布,重新选择");
                return(false);
            }
            else
            {
                BaseIList baseIList = new BaseIList()
                {
                    dingdanhao = lblLYDH.txt.Text,

                    riqi = DateTime.Now,
                    kehu = lblKH.cobodgv.Text,

                    kezong  = lblSYDH.txt.Text,
                    pingmin = lblPM.cobodgv.Text,

                    item0 = lblSYGS.txt.Text,
                    item2 = lblRHLB.cobodgv.Text,

                    item1 = lblDYY.cobodgv.Text,

                    item3  = lblBZ1.txt.Text,
                    leibie = LieBie,
                };
                try
                {
                    db.Insertable <BaseIList>(baseIList).ExecuteCommand();
                    return(true);
                }catch (Exception ex)
                {
                    MessageBoxEx.Show(ex.Message, "提示");
                    return(false);
                }
            }
        }
Ejemplo n.º 9
0
        private void InitValue(BaseIList baseIList)
        {
            lblGH.txt.Text = baseIList.item0;
            lblKH.txt.Text = baseIList.kehu;
            riqi.Value     = baseIList.riqi;
            lblPM.txt.Text = baseIList.pingmin;

            lblSM.txt.Text  = baseIList.seming;
            lblSH.txt.Text  = baseIList.sehao;
            lblMF.txt.Text  = baseIList.menfu;
            lblPS.txt.Text  = baseIList.pishu;
            lblKZ.txt.Text  = baseIList.kezong;
            lblZL.txt.Text  = baseIList.zongliang;
            lblBZ.txt.Text  = baseIList.item1;
            lblDDH.txt.Text = baseIList.item2;
        }
Ejemplo n.º 10
0
        private bool Save()
        {
            var all1 = db.Queryable <LCKA>()
                       .Where(it => int.Parse(it.liushuihao) == int.Parse(lblGH.txt.Text))
                       .OrderBy(it => it.liushuihao, OrderByType.Desc)
                       .First();

            if (all1 == null)
            {
                MessageBoxEx.Show("这没有发现此缸号重新选择");
                return(false);
            }
            else
            {
                BaseIList baseIList = new BaseIList()
                {
                    item0      = lblGH.txt.Text,
                    kehu       = lblKH.txt.Text,
                    dingdanhao = lblDDH.txt.Text,
                    riqi       = DateTime.Now,
                    pingmin    = lblPM.txt.Text,
                    seming     = lblSM.txt.Text,
                    menfu      = lblMF.txt.Text,
                    sehao      = lblSH.txt.Text,
                    pishu      = lblPS.txt.Text,
                    kezong     = lblKZ.txt.Text,
                    zongliang  = lblZL.txt.Text,
                    item1      = lblBZ.txt.Text,
                    item2      = lblTxt1.txt.Text,

                    item3  = string.Join("||", list_value.ToArray()),
                    leibie = benleibie,
                };
                try
                {
                    db.Insertable <BaseIList>(baseIList).ExecuteCommand();
                    return(true);
                }catch (Exception ex)
                {
                    MessageBoxEx.Show(ex.Message, "提示");
                    return(false);
                }
            }
        }
Ejemplo n.º 11
0
        private bool Save()
        {
            /*
             * var all1 = db.Queryable<PeibuCang>()
             *      .Where(it => int.Parse(it.liushuihao) == int.Parse(lblGH.txt.Text))
             *      .OrderBy(it => it.liushuihao, OrderByType.Desc)
             *      .First();
             * if (all1 == null)
             * {
             *  MessageBoxEx.Show("这没有发现此缸号重新选择");
             *  return false;
             * }
             * else
             */
            {
                BaseIList baseIList = new BaseIList()
                {
                    dingdanhao = lblRKDH.txt.Text,
                    riqi       = DateTime.Now,
                    item3      = lblRHMC.cobodgv.Text,

                    item1 = lblRHLB.cobodgv.Text,
                    item0 = lblDJ.txt.Text,
                    item2 = lblGHS.txt.Text,

                    seming    = lblSL.txt.Text,
                    pishu     = lblZL.txt.Text,
                    menfu     = lblBZ.txt.Text,
                    kezong    = lblSL.txt.Text,
                    zongliang = lblZL.txt.Text,
                    leibie    = "染料入库",
                };
                try
                {
                    db.Insertable <BaseIList>(baseIList).ExecuteCommand();
                    return(true);
                }catch (Exception ex)
                {
                    MessageBoxEx.Show(ex.Message, "提示");
                    return(false);
                }
            }
        }
Ejemplo n.º 12
0
        private bool Save()
        {
            bool flag = false;

            try
            {
                var all = db.Queryable <LCKA>().Where(it => it.liushuihao == lblDanh.txt.Text).First();
                if (all == null)
                {
                    MessageBox.Show("这没有发现此缸号重新选择");
                    return(flag);
                }
                var all1 = db.Queryable <BaseIList>().Where(it => it.dingdanhao == lblDanh.txt.Text && it.leibie == LEIBIE).First();
                if (all1 != null)
                {
                    MessageBox.Show("该缸号已登记");
                    return(flag);
                }
                var sd = new BaseIList()
                {
                    dingdanhao = all.liushuihao,
                    kehu       = all.kehu,
                    pingmin    = lblTxt1.cobodgv.Text,
                    seming     = lblTxt2.cobodgv.Text,
                    sehao      = lblZPS.cobodgv.Text,
                    zongliang  = lblZZ.txt.Text,
                    pishu      = lblPS.txt.Text,
                    item0      = lblPIH.txt.Text,
                    item3      = lblBZ1.txt.Text,
                    riqi       = DateTime.Now,
                    leibie     = LEIBIE,
                };
                db.Insertable <BaseIList>(sd).ExecuteCommand();
                flag = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                flag = false;
            }
            return(flag);
        }
Ejemplo n.º 13
0
 private void Showg(List <BaseIList> a)
 {
     if (a == null)
     {
         return;
     }
     dgvEX1.Rows.Clear();
     for (var i = 0; i < a.Count; i++)
     {
         int       index     = dgvEX1.Rows.Add();
         BaseIList baseIList = a[i];
         dgvEX1.Rows[index].Tag            = baseIList.SN;
         dgvEX1.Rows[index].Cells[0].Value = baseIList.SN;
         dgvEX1.Rows[index].Cells[1].Value = baseIList.item0;
         dgvEX1.Rows[index].Cells[2].Value = baseIList.item1;
         dgvEX1.Rows[index].Cells[3].Value = baseIList.item2;
         dgvEX1.Rows[index].Cells[4].Value = baseIList.riqi.ToString("yyyy-MM-dd HH:mm:ss");
         dgvEX1.Rows[index].Cells[5].Value = baseIList.item3;
     }
 }
Ejemplo n.º 14
0
        private bool Save()
        {
            var all1 = db.Queryable <LCKA>()
                       .Where(it => int.Parse(it.liushuihao) <= int.Parse(lblGH.txt.Text))
                       .OrderBy(it => it.liushuihao, OrderByType.Desc)
                       .First();

            if (all1 == null)
            {
                MessageBoxEx.Show("这没有发现此缸号重新选择");
                return(false);
            }
            else
            {
                var aa = db.Queryable <BaseIList>().Where(it => it.item0 == lblGH.txt.Text).First();
                if (aa != null)
                {
                    MessageBoxEx.Show("缸号已在码单,请重新选择", "提示");
                    return(false);
                }
                BaseIList a = new BaseIList()
                {
                    item0     = lblGH.txt.Text,
                    kehu      = lblKH.txt.Text,
                    riqi      = riqi.Value,
                    pingmin   = lblPM.txt.Text,
                    seming    = lblSM.txt.Text,
                    sehao     = lblSH.txt.Text,
                    menfu     = lblMF.txt.Text,
                    pishu     = lblPS.txt.Text,
                    kezong    = lblKZ.txt.Text,
                    zongliang = lblZL.txt.Text,
                    item1     = lblBZ.txt.Text,
                    item2     = lblDDH.txt.Text,
                    leibie    = "码单",
                };
                db.Insertable <BaseIList>(a).ExecuteCommand();
                return(true);
            }
        }
Ejemplo n.º 15
0
 private void ShowData(List <BaseIList> getAll)
 {
     if (getAll == null)
     {
         return;
     }
     dgvEX1.Rows.Clear();
     for (var i = 0; i < getAll.Count; i++)
     {
         BaseIList dataRowCollection = getAll[i];
         int       index             = dgvEX1.Rows.Add();
         dgvEX1.Rows[index].Tag            = dataRowCollection.SN;
         dgvEX1.Rows[index].Cells[0].Value = dataRowCollection.menfu;
         dgvEX1.Rows[index].Cells[1].Value = dataRowCollection.item2;
         dgvEX1.Rows[index].Cells[2].Value = dataRowCollection.item3;
         dgvEX1.Rows[index].Cells[3].Value = dataRowCollection.seming;
         dgvEX1.Rows[index].Cells[4].Value = dataRowCollection.item1;
         dgvEX1.Rows[index].Cells[5].Value = dataRowCollection.item0;
         dgvEX1.Rows[index].Cells[6].Value = dataRowCollection.riqi;
     }
     dgvEX1.HeJi();
 }
Ejemplo n.º 16
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (_SN == -1L)
            {
                if (Query(lblDanh.txt.Text, 0) == 0)
                {
                    if (Save())
                    {
                        var all = db.Queryable <LCKA>().Where(it => it.liushuihao == lblDanh.txt.Text).First();
                        if (all == null)
                        {
                            MessageBox.Show("缸号不存在,进度不能写入", "提示");
                            return;
                        }

                        var asdfg = db.Queryable <BaseIList>()
                                    .Where(it => it.leibie == "产量登记" && it.item1 == "计划" && it.dingdanhao == lblDanh.txt.Text)
                                    .First();
                        if (asdfg == null)
                        {
                            var sd = new BaseIList()
                            {
                                leibie     = "产量登记",
                                dingdanhao = lblDanh.txt.Text,
                                pingmin    = lblTxt1.cobodgv.Text,
                                seming     = lblTxt2.cobodgv.Text,
                                sehao      = lblZPS.cobodgv.Text,
                                item0      = ClsLogUser.XinMing, //操作人员
                                pishu      = lblPS.txt.Text,
                                item1      = "计划",               //工序
                                zongliang  = lblZZ.txt.Text,
                                item2      = "0%",               //百分比
                                riqi       = DateTime.Now,
                                item3      = "计划",
                                kehu       = all.kehu,
                            };
                            db.Insertable <BaseIList>(sd).ExecuteCommand();
                        }

                        if (MessageBox.Show(this, "保存成功,是否退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) != DialogResult.No)
                        {
                            doublelist(this, -1L);
                            Close();
                        }
                    }
                }
                else if (Query(lblDanh.txt.Text, 0) == 1)
                {
                    MessageBox.Show("该工序已登记");
                }
                else
                {
                    MessageBox.Show("不存在此工序");
                }
            }
            else
            {
                if (Edit())
                {
                    if (MessageBox.Show(this, "修改成功,是否退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) != DialogResult.No)
                    {
                        doublelist(this, -1L);
                        Close();
                    }
                }
            }
        }
Ejemplo n.º 17
0
        private bool Save()
        {
            bool flag = false;

            if (lblDanh.txt.Text.Length == 0)
            {
                MessageBox.Show("缸号需要填写");
                lblDanh.txt.Focus();
                return(flag);
            }

            if (lblYWY.cobodgv.Text.Length == 0)
            {
                MessageBox.Show("操作人员必须填写");
                lblYWY.cobodgv.txtbox.Focus();
                return(flag);
            }
            if (lblCW.cobodgv.Text.Length == 0)
            {
                MessageBox.Show("生产工序必须填写");
                lblCW.cobodgv.txtbox.Focus();
                return(flag);
            }
            try
            {
                var all = db.Queryable <LCKA>().Where(it => it.liushuihao == lblDanh.txt.Text).First();
                if (all == null)
                {
                    MessageBox.Show("这没有发现此缸号重新选择");
                    return(flag);
                }
                var all1 = db.Queryable <BaseIList>()
                           .Where(it => it.leibie == LEIBIE && it.dingdanhao == lblDanh.txt.Text && /*it.item0 == lblYWY.cobodgv.Text &&*/ it.item1 == lblCW.cobodgv.Text)
                           .First();
                if (all1 != null)
                {
                    MessageBox.Show("该缸号<>生产工序已登记");
                    return(flag);
                }
                var sd = new BaseIList()
                {
                    leibie     = LEIBIE,
                    dingdanhao = lblDanh.txt.Text,
                    pingmin    = lblTxt1.cobodgv.Text,
                    seming     = lblTxt2.cobodgv.Text,
                    sehao      = lblZPS.cobodgv.Text,
                    item0      = lblYWY.cobodgv.Text, //操作人员
                    pishu      = lblPS.txt.Text,
                    item1      = lblCW.cobodgv.Text,  //工序
                    zongliang  = lblZZ.txt.Text,
                    item2      = lblPIH.txt.Text,     //百分比
                    riqi       = DateTime.Now,
                    item3      = lblBZ1.txt.Text,
                    kehu       = lblKH.cobodgv.Text,
                };
                db.Insertable <BaseIList>(sd).ExecuteCommand();
                flag = true;
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message);
                flag = false;
            }
            return(flag);
        }
Ejemplo n.º 18
0
        private void button5_Click(object sender, EventArgs e)
        {
            LCKA lcka = getByWhere[0];

            UserProc.WaitStart(this);
            string asd = lcka.riqiZhidan.ToString("yy-MM-dd HH:mm");

            //asd = asd.Replace("月", "-").Replace("日", "");
            Console.WriteLine("-------------" + asd);
            List <LCKA> list = new List <LCKA>();

            if (lcka == null)
            {
                MessageBox.Show(this, "该流程卡已不存在!请核对!", "提示");
                UserProc.WaitEnd(this);
            }
            else
            {
                var asdfg = db.Queryable <BaseIList>()
                            .Where(it => it.leibie == "产量登记" && it.item1 == "开卡" && it.dingdanhao == lcka.liushuihao)
                            .First();
                if (asdfg == null)
                {
                    var sd = new BaseIList()
                    {
                        leibie     = "产量登记",
                        dingdanhao = lcka.liushuihao,
                        pingmin    = lcka.peiming,
                        seming     = lcka.sebie,
                        sehao      = lcka.sehao,
                        item0      = ClsLogUser.XinMing, //操作人员
                        pishu      = lcka.peishu,
                        item1      = "开卡",               //工序
                        zongliang  = lcka.zhongliang,
                        item2      = "0%",               //百分比
                        riqi       = DateTime.Now,
                        item3      = "开卡",
                        kehu       = lcka.kehu,
                    };
                    db.Insertable <BaseIList>(sd).ExecuteCommand();
                }

                list.Add(lcka);

                /*
                 * if (lcka.zonggangshu == "" || !UserProc.IsInt(lcka.zonggangshu))
                 * {
                 *  list.Add(lcka);
                 * }
                 * else
                 * {
                 *  int num = Convert.ToInt32(lcka.zonggangshu);
                 *  for (int i = 0; i < num; i++)
                 *  {
                 *      LCKA asd1 = new LCKA();
                 *      asd1 = TransExpV2<LCKA, LCKA>.Trans(lcka);
                 *      asd1.liushuihao = string.Format("{0}", (int.Parse(lcka.liushuihao) + i));
                 *      list.Add(asd1);
                 *  }
                 * }
                 */
                FrmPrn frmPrn = new FrmPrn();
                frmPrn.rptView.LocalReport.ReportEmbeddedResource = "DotNetBarProject.view.Report2.rdlc";

                string filename = Application.StartupPath + "\\imgLCK.Bmp";
                pictureBox1.Image.Save(filename, ImageFormat.Bmp);
                string str = "file:///" + filename.Replace("\\", "/");
                frmPrn.rptView.LocalReport.EnableExternalImages = true;
                ReportParameter reportParameter1 = new ReportParameter("LDH", str);

                ReportParameter parameters  = new ReportParameter("p1", sclcgx.txt.Text);
                ReportParameter parameters1 = new ReportParameter("riqi", asd);

                string[] array = new string[30];
                var      asde  = db.Queryable <LCMX>().Where(it => it.SNka == lcka.SN).ToList();
                //string[] asdf = sclcgx.txt.Text.Split("->".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                for (var i = 0; i < asde.Count; i++)
                {
                    array[i] = asde[i].gongxu;
                }
                for (int i = asde.Count; i < 30; i++)
                {
                    array[i] = "";
                }
                ReportParameter parameters2 = new ReportParameter("p2", array);
                //BindingSource asdfds = new BindingSource();
                //asdfds.DataSource = asde;
                //ReportDataSource reportDataSource1 = new ReportDataSource();
                //reportDataSource1.Name = "lblcmx";
                //reportDataSource1.Value = asdfds;

                frmPrn.rptView.LocalReport.SetParameters(parameters);
                frmPrn.rptView.LocalReport.SetParameters(parameters1);
                frmPrn.rptView.LocalReport.SetParameters(reportParameter1);
                frmPrn.rptView.LocalReport.SetParameters(parameters2);
                frmPrn.rptView.LocalReport.DataSources.Clear();
                ReportDataSource reportDataSource = new ReportDataSource();
                reportDataSource.Name  = "DataSet1";
                reportDataSource.Value = list;
                frmPrn.rptView.LocalReport.DataSources.Clear();
                frmPrn.rptView.LocalReport.DataSources.Add(reportDataSource);
                //frmPrn.rptView.LocalReport.DataSources.Add(reportDataSource1);
                var a = frmPrn.rptView.LocalReport.DataSources;
                frmPrn.rptView.RefreshReport();
                frmPrn.ShowDialog();
                frmPrn.Close();
                UserProc.WaitEnd(this);
            }
        }
Ejemplo n.º 19
0
        private bool Save()
        {
            if (lblKCDH.txt.Text.Length == 0)
            {
                MessageBoxEx.Show("请选择领用染料", "提示");
                return(false);
            }
            var all1 = db.Queryable <BaseIList>()
                       .Where(it => it.dingdanhao == lblKCDH.txt.Text)
                       .OrderBy(it => it.SN, OrderByType.Desc)
                       .First();

            if (all1 == null)
            {
                MessageBoxEx.Show("没有发现此该染料,重新选择");
                return(false);
            }
            else
            {
                var a = db.Queryable <BaseIList>()
                        .Where(it => it.dingdanhao == lblKCDH.txt.Text)
                        .First();
                if (lblZL.txt.Text.Length == 0)
                {
                    MessageBoxEx.Show("重量必须填写");
                    return(false);
                }
                if (lblSL.txt.Text.Length == 0)
                {
                    MessageBoxEx.Show("数量必须填写");
                    return(false);
                }
                BaseIList baseIList = new BaseIList()
                {
                    kehu       = lblKCDH.txt.Text,
                    dingdanhao = lblRKDH.txt.Text,
                    //lblKCDH.txt.Text = baseIList.kehu;
                    //lblRKDH.txt.Text = baseIList.dingdanhao;
                    item3  = lblRHMC.cobodgv.Text,
                    item1  = lblRHLB.cobodgv.Text,
                    seming = lblSL.txt.Text,
                    item0  = lblDJ.txt.Text,

                    riqi   = DateTime.Now,
                    pishu  = lblZL.txt.Text,
                    menfu  = lblBZ1.txt.Text,
                    item2  = lblGHS.txt.Text,
                    leibie = "染料领用",
                };
                try
                {
                    db.Insertable <BaseIList>(baseIList).ExecuteCommand();
                    a.pishu  = (Int32.Parse(a.pishu) - Int32.Parse(lblZL.txt.Text)) + "";
                    a.seming = (Int32.Parse(a.seming) - Int32.Parse(lblSL.txt.Text)) + "";
                    db.Updateable <BaseIList>(a).ExecuteCommand();
                    return(true);
                }catch (Exception ex)
                {
                    MessageBoxEx.Show(ex.Message, "提示");
                    return(false);
                }
            }
        }