Exemplo n.º 1
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     if (gx.Text != "分切" & gx.Text != "制袋" & gx.Text != "包装")
     {
         string ptnr = gx.Text + "|" + label6.Text + "|" + label8.Text + "|" + gctm.Text + "|" + jtmc.Text + "|" + jlr.Text + "|" + jlrq.Text + "|" + jyy.Text + "|" + bc.Text + "|" + mcd.Text + "|" + ngx.Text + "|" + wlkd.Text;
         FPt    pt   = new FPt(ptnr);
     }
     if (gx.Text == "分切")
     {
         string ptnr = label6.Text + "-" + zxh.Text + "-" + daos.Text + "-" + js.Text + "(" + Globals.userid + ")" + "|" + gctm.Text + "|" + label8.Text;
         FPt    pt   = new FPt(ptnr, 1);
     }
     if (gx.Text == "包装")
     {
         string ptnr = label7.Text + "|" + label8.Text + "|" + wlms.Text + "|" + wlbz.Text + "|" + wlkd.Text + "|" + label6.Text + "|" + zxjs.Text + "卷|" + decimal.Parse(mzl.Text).ToString("#0.00") + "kg|" + zxh.Text + "|" + jlrq.Text + "|" + gctm.Text;
         FPt    pt   = new FPt(ptnr, 2);
     }
 }
Exemplo n.º 2
0
 private void toolStripButton5_Click(object sender, EventArgs e)
 {
     //判断是否批量打印
     if (pldy.Checked)
     {
         string    sql1 = "select sum(fqty) /COUNT(fqty) dyzl from  tgx  where FWork='包装'  and FICMOBillNo='" + comboBox1.Text.Trim() + "'";
         DataTable dyzl = sj.ds(sql1, "tgx", conn);
         string    sql  = "select FBarcode,FXh,fjs from  tgx  where FWork='包装'  and FICMOBillNo='" + comboBox1.Text.Trim() + "'";
         DataTable jl   = sj.ds(sql, "tgx", conn);
         for (int i = 0; i < jl.Rows.Count; i++)
         {
             string ptnr = label7.Text + "|" + label8.Text + "|" + wlms.Text + "|" + wlbz.Text + "|" + wlkd.Text + "|" + label6.Text + "|" + jl.Rows[i]["fjs"] + "卷|" + decimal.Parse(dyzl.Rows[0][0].ToString()).ToString("#0.00") + "kg|" + jl.Rows[i]["FXh"] + "|" + jlrq.Text + "|" + jl.Rows[i]["FBarcode"];
             FPt    pt   = new FPt(ptnr, 2);
         }
     }
     else
     {
     }
 }
Exemplo n.º 3
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            // FPt pt1 = new FPt("", 1);
            if (dataGridView1.RowCount <= 1)
            {
                MessageBox.Show("信息不全不能保存");
                return;
            }
            for (int i = 0; i < dataGridView1.RowCount - 1; i++)
            {
                if (dataGridView1.Rows[i].Cells["sycd1"].Value == null)
                {
                    MessageBox.Show("使用长度必须为数字");

                    return;
                }

                if (!Globals.CheckNumber(dataGridView1.Rows[i].Cells["sycd1"].Value.ToString().Trim()))
                {
                    MessageBox.Show("使用长度必须为数字");

                    return;
                }
                if (decimal.Parse(dataGridView1.Rows[i].Cells["sycd1"].Value.ToString().Trim()) > decimal.Parse(dataGridView1.Rows[i].Cells["kycd"].Value.ToString().Trim()))
                {
                    MessageBox.Show("使用长度不能超可用长度");
                    dataGridView1.Rows[i].Cells["sycd1"].Value           = null;
                    dataGridView1.Rows[i].Cells["sycd1"].Style.BackColor = Color.Red;

                    return;
                }
            }


            if (MessageBox.Show("是否需要保存", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;  //否就退出操作
            }

            if (js.Text != "")
            {
                if (!Globals.CheckNumber(js.Text.ToString().Trim()))
                {
                    MessageBox.Show("卷数必须为数字");
                    js.Text = null;
                    return;
                }
            }
            else
            {
                MessageBox.Show("卷数必须录入");
                // mkd.Text = null;
                return;
            }
            if (mcd.Text != "")
            {
                if (!Globals.CheckNumber(mcd.Text.ToString().Trim()))
                {
                    MessageBox.Show("膜长度必须为数字");
                    mkd.Text = null;
                    return;
                }
            }
            else
            {
                MessageBox.Show("膜长度必须录入");
                return;
            }
            if (qds.Text != "")
            {
                if (!Globals.CheckNumber(qds.Text.ToString().Trim()))
                {
                    MessageBox.Show("刀数必须为数字");
                    qds.Text = null;
                    return;
                }
            }
            else
            {
                MessageBox.Show("刀数必须录入");
                return;
            }
            if (dataGridView1.RowCount < 1)
            {
                MessageBox.Show("信息不全不能保存");
                return;
            }
            try
            {
                ds.Tables["tgx"].Clear();
            }
            catch { }
            try
            {
                ds.Tables["gxb"].Clear();
            }
            catch { }
            string         insertsql = "SELECT  FBarcode, FWork, FQty, FMcd, FMkd, FMhd, FJs, FBc, FJyy, FBz, FUnitID, FICMOID, FItemID, FJlr, FJlrq,FRkd, FSfrk, FSfyw, FICMOBillNo ,FBatchNo ,FMustSh,Fjh,Fds,FXh FROM  Tgx where 1=2 ";
            SqlDataAdapter gxjl      = new SqlDataAdapter(insertsql, conn);

            gxjl.Fill(ds, "tgx");
            SqlCommandBuilder sb1    = new SqlCommandBuilder(gxjl);
            string            sql    = "select fyctm,fsycd,FCptm from Tylcpgx  where 1=2";//保存对应关系到Tylcpgx表
            SqlDataAdapter    dtylgx = new SqlDataAdapter(sql, conn);

            dtylgx.Fill(ds, "gxb");//过程记录表

            SqlCommandBuilder sb = new SqlCommandBuilder(dtylgx);
            DataRow           newrowgx;
            DataRow           newrow;
            string            tm;
            string            tmhb = "";


            string    sqlmax  = "select FXh ,FJlrq from tgx  where FICMOBillNo='" + comboBox1.SelectedValue + "' and FWork='分切'  order  by FXh desc";
            DataTable maxdata = sj.ds(sqlmax, "zdz", conn);

            if (maxdata.Rows.Count < 1)
            {
                zxh.Text  = "1";
                jlrq.Text = DateTime.Now.ToString();
            }
            else
            {
                zxh.Text  = (int.Parse(maxdata.Rows[0][0].ToString()) + 1).ToString();
                jlrq.Text = maxdata.Rows[0][1].ToString();
            }



            for (int j = 0; j < int.Parse(qds.Text.Trim()); j++)    //刀数控制
            {
                for (int i = 0; i < int.Parse(js.Text.Trim()); i++) //卷数控制
                {
                    newrowgx = ds.Tables["tgx"].NewRow();

                    newrowgx["FBarcode"] = tm = wl.Text.PadLeft(5, '0') + Globals.GetTimeStamp();
                    for (int k = 0; k < dataGridView1.RowCount - 1; k++)
                    {
                        newrow          = ds.Tables["gxb"].NewRow();
                        newrow["fcptm"] = newrowgx["FBarcode"];
                        newrow["fyctm"] = dataGridView1.Rows[k].Cells["tm"].Value.ToString();

                        try
                        {
                            if (dataGridView1.Rows[i].Cells["yw"].Value.ToString() == "是")
                            {
                                newrow["fsycd"] = (decimal.Parse(dataGridView1.Rows[k].Cells["kycd"].Value.ToString()) / int.Parse(js.Text.Trim()) / int.Parse(qds.Text.Trim())).ToString(("#0.0000"));
                            }
                            else
                            {
                                newrow["fsycd"] = (decimal.Parse(dataGridView1.Rows[k].Cells["sycd1"].Value.ToString()) / int.Parse(js.Text.Trim()) / int.Parse(qds.Text.Trim())).ToString(("#0.0000"));
                            }
                        }
                        catch
                        {
                            newrow["fsycd"] = (decimal.Parse(dataGridView1.Rows[k].Cells["sycd1"].Value.ToString()) / int.Parse(js.Text.Trim()) / int.Parse(qds.Text.Trim())).ToString(("#0.0000"));
                        }


                        // newrow["fsycd"] = (decimal.Parse(dataGridView1.Rows[k].Cells["sycd1"].Value.ToString()) / int.Parse(js.Text.Trim()) / int.Parse(qds.Text.Trim())).ToString(("#0.0000"));
                        ds.Tables["gxb"].Rows.Add(newrow);
                    }

                    tmhb += tm + "|";
                    Thread.Sleep(1);
                    newrowgx["FWork"] = "分切";
                    if (mzl.Text != "")
                    {
                        newrowgx["fqty"] = mzl.Text.Trim();
                    }
                    if (mcd.Text != "")
                    {
                        newrowgx["fmcd"] = mcd.Text.Trim();
                    }
                    if (mkd.Text != "")
                    {
                        newrowgx["fmkd"] = mkd.Text.Trim();
                    }
                    if (mhd.Text != "")
                    {
                        newrowgx["FMhd"] = mhd.Text.Trim();
                    }
                    newrowgx["fbc"]         = bc.Text;
                    newrowgx["FJyy"]        = jyy.Text;
                    newrowgx["fbz"]         = bz.Text;
                    newrowgx["FJlr"]        = jlr.Text;
                    newrowgx["FJlrq"]       = jlrq.Text;
                    newrowgx["FItemID"]     = wl.Text;
                    newrowgx["FRkd"]        = (rkd.Text == "1") ? true : false;
                    newrowgx["FICMOBillNo"] = comboBox1.Text;
                    newrowgx["FBatchNo"]    = label6.Text;
                    newrowgx["FXh"]         = zxh.Text;
                    newrowgx["Fjh"]         = i + 1; //  卷号
                    newrowgx["FDs"]         = j + 1; //刀数
                    ds.Tables["tgx"].Rows.Add(newrowgx);
                    //  newrow["fyctm"] = dataGridView1.Rows[0].Cells["tm"].Value.ToString();
                    // newrow["fsycd"] =     (decimal.Parse(dataGridView1.Rows[0].Cells["sycd1"].Value.ToString()) / int.Parse(js.Text.Trim())/int.Parse(qds.Text.Trim())).ToString(("#0.0000"));
                    // newrow["flx"] = true;
                    // newrow["fcptm"] = gctm.Text;
                }
            }

            gxjl.Update(ds.Tables["tgx"]);
            dtylgx.Update(ds.Tables["gxb"]);


            //打印标签
            for (int j = 0; j < int.Parse(qds.Text.Trim()); j++)
            {
                for (int i = 0; i < int.Parse(js.Text.Trim()); i++)
                {
                    string ptnr = label6.Text + "-" + zxh.Text + "-" + (j + 1).ToString() + "-" + (i + 1).ToString() + "(" + Globals.userid + ")" + "|" + tmhb.Split('|')[i] + "|" + label8.Text;
                    FPt    pt   = new FPt(ptnr, 1);
                }
            }

            conn.Close();


            try
            {
                yscl.Text = (decimal.Parse(yscl.Text.Trim()) + decimal.Parse(mcd.Text.Trim()) * int.Parse(js.Text.Trim()) * int.Parse(qds.Text.Trim())).ToString();
            }
            catch
            {
                yscl.Text = (decimal.Parse(mcd.Text.Trim()) * int.Parse(js.Text.Trim()) * int.Parse(qds.Text.Trim())).ToString();
            }
            clearjm();
            label14.Text = "";
            label5.Text  = "";
            zxh.Clear();
            qds.Clear();
            dataGridView1.Rows.Clear();
            if (!lgxl())
            {
                MessageBox.Show("料已用完");
            }
        }
Exemplo n.º 4
0
        //保存
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            if (!Globals.CheckNumber(mcd.Text.ToString().Trim()))
            {
                MessageBox.Show("膜长度必须为数字");
                mcd.Text = null;
                return;
            }
            if (mkd.Text != "")
            {
                if (!Globals.CheckNumber(mkd.Text.ToString().Trim()))
                {
                    MessageBox.Show("膜宽度必须为数字");
                    mkd.Text = null;
                    return;
                }
            }

            if (dataGridView1.RowCount <= 1 | gctm.Text == "")
            {
                MessageBox.Show("信息不全不能保存");
                return;
            }
            for (int i = 0; i < dataGridView1.RowCount - 1; i++)
            {
                if (dataGridView1.Rows[i].Cells["sycd1"].Value == null)
                {
                    MessageBox.Show("使用长度必须为数字");

                    return;
                }

                if (!Globals.CheckNumber(dataGridView1.Rows[i].Cells["sycd1"].Value.ToString().Trim()))
                {
                    MessageBox.Show("使用长度必须为数字");

                    return;
                }

                if (decimal.Parse(dataGridView1.Rows[i].Cells["sycd1"].Value.ToString().Trim()) > decimal.Parse(dataGridView1.Rows[i].Cells["kycd"].Value.ToString().Trim()))
                {
                    MessageBox.Show("使用长度不能超可用长度");
                    dataGridView1.Rows[i].Cells["sycd1"].Value           = null;
                    dataGridView1.Rows[i].Cells["sycd1"].Style.BackColor = Color.Red;
                    return;
                }
            }

            if (MessageBox.Show("是否需要保存", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;  //否就退出操作
            }
            try
            {
                ds.Tables["tgx"].Clear();
            }
            catch { }
            try
            {
                ds.Tables["gxb"].Clear();
            }
            catch { }
            //try
            //{
            //    conn.Open();
            //}
            //catch { }
            //DataSet ds = new DataSet();
            //修改tyl表的 FSylength=FSylength-sycd
            string         insertsql = "SELECT  FBarcode, FWork, FQty, FMcd, FMkd, FMhd, FJs, FBc, FJyy, FBz, FUnitID, FICMOID, FItemID, FJlr, FJlrq,FRkd, FSfrk, FSfyw, FICMOBillNo ,FBatchNo,fscjt FROM  Tgx where 1=2 ";
            SqlDataAdapter gxjl      = new SqlDataAdapter(insertsql, conn);

            gxjl.Fill(ds, "tgx");
            DataRow newrowgx = ds.Tables["tgx"].NewRow();

            newrowgx["FBarcode"] = gctm.Text.Trim();
            newrowgx["FWork"]    = "检品";
            if (mzl.Text != "")
            {
                newrowgx["fqty"] = mzl.Text.Trim();
            }
            if (mcd.Text != "")
            {
                newrowgx["fmcd"] = mcd.Text.Trim();
            }
            if (mkd.Text != "")
            {
                newrowgx["fmkd"] = mkd.Text.Trim();
            }
            if (mhd.Text != "")
            {
                newrowgx["FMhd"] = mhd.Text.Trim();
            }
            newrowgx["fbc"]         = bc.Text;
            newrowgx["FJyy"]        = jyy.Text;
            newrowgx["fbz"]         = bz.Text;
            newrowgx["FJlr"]        = jlr.Text;
            newrowgx["FJlrq"]       = jlrq.Text;
            newrowgx["Fscjt"]       = jtmc.Text;
            newrowgx["FItemID"]     = wl.Text;
            newrowgx["FRkd"]        = (rkd.Text == "1") ? true : false;
            newrowgx["FICMOBillNo"] = comboBox1.Text;
            newrowgx["FBatchNo"]    = label6.Text;

            ds.Tables["tgx"].Rows.Add(newrowgx);

            SqlCommandBuilder sb1 = new SqlCommandBuilder(gxjl);
            //gxjl.Update(ds.Tables["tgx"]);

            //插入数据到tycpgx  原料产品关系对照表   FYctm    FSycd   FCptm
            string sql = "select fyctm,fsycd,FCptm from Tylcpgx  where 1=2";

            SqlDataAdapter dtylgx = new SqlDataAdapter(sql, conn);

            dtylgx.Fill(ds, "gxb");
            //批量写入原料与产品关系表
            for (int i = 0; i < dataGridView1.RowCount - 1; i++)
            {
                if (dataGridView1.Rows[i].Cells["kycd"].Value == null)
                {
                    MessageBox.Show("必须录入膜使用长度");
                    ds.Tables["gxb"].Clear();
                    return;
                }
                DataRow newrow = ds.Tables["gxb"].NewRow();
                newrow["fyctm"] = dataGridView1.Rows[i].Cells["tm"].Value.ToString();
                try
                {
                    if (dataGridView1.Rows[i].Cells["yw"].Value.ToString() == "是")
                    {
                        newrow["fsycd"] = dataGridView1.Rows[i].Cells["kycd"].Value.ToString();
                    }
                    else
                    {
                        newrow["fsycd"] = dataGridView1.Rows[i].Cells["sycd1"].Value.ToString();
                    }
                }
                catch { newrow["fsycd"] = dataGridView1.Rows[i].Cells["sycd1"].Value.ToString(); }
                newrow["fcptm"] = gctm.Text;
                ds.Tables["gxb"].Rows.Add(newrow);
            }
            SqlCommandBuilder sb = new SqlCommandBuilder(dtylgx);

            gxjl.Update(ds.Tables["tgx"]);
            dtylgx.Update(ds.Tables["gxb"]);
            conn.Close();
            string ptnr = "检品|" + label6.Text + "|" + label8.Text + "|" + gctm.Text + "|" + jtmc.Text + "|" + Globals.usernm + "|" + jlrq.Text + "|" + jyy.Text + "|" + bc.Text + "|" + mcd.Text + "|" + ngx.Text + "|" + wlkd.Text;
            FPt    pt   = new FPt(ptnr);

            try
            {
                yscl.Text = (decimal.Parse(yscl.Text.Trim()) + decimal.Parse(mcd.Text.Trim())).ToString();
            }
            catch {
                yscl.Text = (decimal.Parse(mcd.Text.Trim())).ToString();
            }
            clearjm();
            dataGridView1.Rows.Clear();
            if (!lgxl())
            {
                MessageBox.Show("领料失败");
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            dataGridView1.EndEdit();
            if (!Globals.CheckNumber(mcd.Text.ToString().Trim()))
            {
                MessageBox.Show("膜长度必须为数字");
                mcd.Text = null;
                return;
            }
            if (mkd.Text != "")
            {
                if (!Globals.CheckNumber(mkd.Text.ToString().Trim()))
                {
                    MessageBox.Show("膜宽度必须为数字");
                    mkd.Text = null;
                    return;
                }
            }


            if (dataGridView1.RowCount <= 1 | gctm.Text == "")
            {
                MessageBox.Show("信息不全不能保存");
                return;
            }
            for (int i = 0; i < dataGridView1.RowCount - 1; i++)
            {
                if (dataGridView1.Rows[i].Cells["sycd"].Value == null)
                {
                    MessageBox.Show("使用长度必须为数字");

                    return;
                }



                if (!Globals.CheckNumber(dataGridView1.Rows[i].Cells["sycd"].Value.ToString().Trim()))
                {
                    MessageBox.Show("使用长度必须为数字");

                    return;
                }

                if (decimal.Parse(dataGridView1.Rows[i].Cells["sycd"].Value.ToString().Trim()) > decimal.Parse(dataGridView1.Rows[i].Cells["mc"].Value.ToString().Trim()))
                {
                    MessageBox.Show("使用长度不能超过膜长度");
                    dataGridView1.Rows[i].Cells["sycd"].Value           = null;
                    dataGridView1.Rows[i].Cells["sycd"].Style.BackColor = Color.Red;
                    return;
                }
            }

            if (MessageBox.Show("是否需要保存", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;  //否就退出操作
            }
            try
            {
                ds.Tables["tgx"].Clear();
            }
            catch { }
            try
            {
                ds.Tables["gxb"].Clear();
            }
            catch { }
            //try
            //{
            //    conn.Open();
            //}
            //catch { }
            // DataSet ds = new DataSet();
            //修改tyl表的 FSylength=FSylength-sycd
            string         insertsql = "SELECT  FBarcode, FWork, FQty, FMcd, FMkd, FMhd, FJs, FBc, FJyy, FBz, FUnitID, FICMOID, FItemID, FJlr, FJlrq,FRkd, FSfrk, FSfyw, FICMOBillNo ,FBatchNo,fscjt FROM  Tgx where 1=2 ";
            SqlDataAdapter gxjl      = new SqlDataAdapter(insertsql, conn);

            gxjl.Fill(ds, "tgx");
            DataRow newrowgx = ds.Tables["tgx"].NewRow();

            newrowgx["FBarcode"] = gctm.Text.Trim();
            newrowgx["FWork"]    = "印刷";
            if (mzl.Text != "")
            {
                newrowgx["fqty"] = mzl.Text.Trim();
            }
            if (mcd.Text != "")
            {
                newrowgx["fmcd"] = mcd.Text.Trim();
            }
            if (mkd.Text != "")
            {
                newrowgx["fmkd"] = mkd.Text.Trim();
            }
            if (mhd.Text != "")
            {
                newrowgx["FMhd"] = mhd.Text.Trim();
            }
            newrowgx["fbc"]         = bc.Text;
            newrowgx["FJyy"]        = jyy.Text;
            newrowgx["fbz"]         = bz.Text;
            newrowgx["FJlr"]        = jlr.Text;
            newrowgx["FJlrq"]       = jlrq.Text;
            newrowgx["Fscjt"]       = comboBox3.Text;
            newrowgx["FItemID"]     = wl.Text;
            newrowgx["FRkd"]        = (rkd.Text == "1") ? true : false;
            newrowgx["FICMOBillNo"] = comboBox1.Text;
            newrowgx["FBatchNo"]    = label6.Text;
            ds.Tables["tgx"].Rows.Add(newrowgx);

            SqlCommandBuilder sb1 = new SqlCommandBuilder(gxjl);
            //gxjl.Update(ds.Tables["tgx"]);

            //插入数据到tycpgx  原料产品关系对照表   FYctm    FSycd   FCptm
            string sql = "select fyctm,fsycd,FCptm from Tylcpgx  where 1=2";

            SqlDataAdapter dtylgx = new SqlDataAdapter(sql, conn);

            dtylgx.Fill(ds, "gxb");
            //批量写入原料与产品关系表
            for (int i = 0; i < dataGridView1.RowCount - 1; i++)
            {
                if (dataGridView1.Rows[i].Cells["sycd"].Value.ToString().Trim() == null)
                {
                    MessageBox.Show("必须录入膜使用长度");
                    ds.Tables["gxb"].Clear();
                    return;
                }
                DataRow newrow = ds.Tables["gxb"].NewRow();
                newrow["fyctm"] = dataGridView1.Rows[i].Cells["tm"].Value.ToString();
                try
                {
                    if (dataGridView1.Rows[i].Cells["wj"].Value.ToString() == "是")
                    {
                        newrow["fsycd"] = dataGridView1.Rows[i].Cells["mc"].Value.ToString().Trim();
                    }
                    else
                    {
                        newrow["fsycd"] = dataGridView1.Rows[i].Cells["sycd"].Value.ToString().Trim();
                    }
                }
                catch { newrow["fsycd"] = dataGridView1.Rows[i].Cells["sycd"].Value.ToString().Trim(); }
                newrow["fcptm"] = gctm.Text;
                ds.Tables["gxb"].Rows.Add(newrow);
            }
            SqlCommandBuilder sb = new SqlCommandBuilder(dtylgx);

            gxjl.Update(ds.Tables["tgx"]);
            dtylgx.Update(ds.Tables["gxb"]);
            string ptnr = "印刷|" + label6.Text + "|" + label8.Text + "|" + gctm.Text + "|" + comboBox3.Text + "|" + Globals.usernm + "|" + jlrq.Text + "|" + jyy.Text + "|" + bc.Text + "|" + mcd.Text + "|" + ngx.Text + "|" + wlkd.Text;
            FPt    pt   = new FPt(ptnr);

            conn.Close();
            try
            {
                yscl.Text = (decimal.Parse(yscl.Text.Trim()) + decimal.Parse(mcd.Text.Trim())).ToString();
            }
            catch
            {
                yscl.Text = (decimal.Parse(mcd.Text.Trim())).ToString();
            }
            string yltm = "";

            yltm = "(";
            for (int i = 0; i < dataGridView1.RowCount - 1; i++)
            {
                yltm += "'" + dataGridView1.Rows[i].Cells["tm"].Value + "',";
            }
            yltm = yltm.Substring(0, yltm.Length - 1);
            yltm = yltm + ")";


            string tl = "select FLength-yycd  sycd,fname,FYltm,  fqty - yycd * ISNULL(fcoefficient , 1) syzl,Frkrq,gys,hjph,FBatchNo from V_TYl  where FLength-yycd>0  and FYltm in" + yltm;



            DataTable tld = sj.ds(tl, "tl", conn);
            FPt       pt1;

            for (int i = 0; i < tld.Rows.Count; i++)
            {
                string pttlnr = "";
                pttlnr = tld.Rows[i]["fname"].ToString() + "|" + tld.Rows[i]["FYltm"].ToString() + "|" + decimal.Parse(tld.Rows[i]["sycd"].ToString()).ToString("#0") + "|" + Math.Round(decimal.Parse(tld.Rows[i]["syzl"].ToString()), 2) + "|" + tld.Rows[i]["Frkrq"].ToString() + "|" + tld.Rows[i]["gys"].ToString() + "|" + tld.Rows[i]["hjph"].ToString() + "|" + tld.Rows[i]["FBatchNo"].ToString();
                pt1    = new FPt(pttlnr, 4);
            }

            clearjm();
            lyl();
        }