Esempio n. 1
0
        private void frmClientChoose3_Load(object sender, EventArgs e)
        {
            ProInGenerator proIn = new ProInGenerator();

            ProInID = proIn.proInGenerator();
            ChooseProductGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            string sql = "select CusShort as 客户,zhuananid as 专案编号,productName as 品名,producttYPE as 箱式,plength as 长,pwide as 宽,pheight as 高,unit as 单位,materialName as 纸板名称,orderquantity as 订单数量,proquantity as 已产数量,(orderquantity-proquantity)as 未产数量 from T_proin where id is null and zhuananid is not null or id  in(select max(id) from T_proin group by zhuananid having max(id)is not null )";

            DataTable Datatable;

            Datatable = dbexe.getdataset(sql, "T_proin").Tables[0];



            for (int i = 0; i < Datatable.Rows.Count; i++)
            {
                if (Datatable.Rows[i]["已产数量"].ToString() == "")
                {
                    Datatable.Rows[i]["已产数量"] = "0";
                    Datatable.Rows[i]["未产数量"] = Datatable.Rows[i]["订单数量"];
                }

                /*else
                 * {
                 *  string QuantityQuery = "select sum(proinquantity) from T_productin group by zhuananID having sum(proinquantity)is not null and zhuananID='"++"'";
                 *  string Supid = databaseexe.getTopselect(SupidQuery, "Supid");
                 * }*/
            }

            ChooseProductGridView1.DataSource = Datatable;
            ChooseProductGridView1.EnableHeadersVisualStyles               = false;
            ChooseProductGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            ChooseProductGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            ChooseProductGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 2
0
        private void frmClientAdd_Load(object sender, EventArgs e)
        {
            string sql1 = "select CusBank from  T_customer where CusId='" + textBoxCusId.Text.Trim() + "'";

            DataTable de =
                dbexe.getdataset(sql1, "T_customer").Tables[0];

            for (int i = 0; i < de.Rows.Count; i++)
            {
                DataRow dc = de.Rows[i];
                textBoxBank.Text = dc["CusBank"].ToString();
            }
            string sql2 = "select CusAccount from  T_customer where CusId='" + textBoxCusId.Text.Trim() + "'";

            DataTable da =
                dbexe.getdataset(sql2, "T_customer").Tables[0];

            for (int i = 0; i < da.Rows.Count; i++)
            {
                DataRow db = da.Rows[i];
                textBoxAccount.Text = db["CusAccount"].ToString();
            }
            string sql3 = "select CusMemo from  T_customer where CusId='" + textBoxCusId.Text.Trim() + "'";

            DataTable df =
                dbexe.getdataset(sql3, "T_customer").Tables[0];

            for (int i = 0; i < df.Rows.Count; i++)
            {
                DataRow dk = df.Rows[i];
                textBoxMemo.Text = dk["CusMemo"].ToString();
            }
        }
Esempio n. 3
0
        private void frmDeliveryChoose5_Load(object sender, EventArgs e)
        {
            DeliveryGenerator delivery = new DeliveryGenerator();

            DeliveryId = delivery.deliveryGenerator();
            FixProductGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            string    sql = "select CusShort as 客户,zhuananid as 专案编号,Orderid as 订单号,productName as 品名,producttYPE as 箱式,plength as 长,pwide as 宽,pheight as 高,unit as 单位,materialName as 纸板名称,orderquantity as 订单数量, deliveryquantity as 已送数量,(orderquantity-deliveryquantity)as 未送数量,deliverytime as 交货日期 from T_delout where id is null and zhuananid is not null or id  in(select max(id) from T_delout group by zhuananid having max(id)is not null )";
            DataTable Datatable;

            Datatable = dbexe.getdataset(sql, "T_delout").Tables[0];
            for (int i = 0; i < Datatable.Rows.Count; i++)
            {
                if (Datatable.Rows[i]["已送数量"].ToString() == "")
                {
                    Datatable.Rows[i]["已送数量"] = "0";
                    Datatable.Rows[i]["未送数量"] = Datatable.Rows[i]["订单数量"];
                }
                if (int.Parse(Datatable.Rows[i]["未送数量"].ToString()) < 0)
                {
                    Datatable.Rows[i]["未送数量"] = "0";
                }

                /*else
                 * {
                 *  string QuantityQuery = "select sum(proinquantity) from T_productin group by zhuananID having sum(proinquantity)is not null and zhuananID='"++"'";
                 *  string Supid = databaseexe.getTopselect(SupidQuery, "Supid");
                 * }*/
            }

            FixProductGridView1.DataSource = Datatable;
            FixProductGridView1.EnableHeadersVisualStyles               = false;
            FixProductGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 9, FontStyle.Bold);
            FixProductGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            FixProductGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 4
0
        public void dgload(string purchaseId)
        {
            textBoxPurchaseid.Text = purchaseId;

            PurchaseOrderdataGridView2.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            string sql = "select id as 采购序号,materialName as 纸板名称, bomsize as 规格,purchasequantity as 数量,price as 单价,purchasequantity*price as 金额 from T_pur where purchaseid='" + purchaseId + "'";

            PurchaseOrderdataGridView2.DataSource =

                dbexe.getdataset(sql, "T_pur").Tables[0];
            PurchaseOrderdataGridView2.EnableHeadersVisualStyles               = false;
            PurchaseOrderdataGridView2.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 9, FontStyle.Bold);
            PurchaseOrderdataGridView2.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            PurchaseOrderdataGridView2.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;


            ClientdataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            string sql1 = "select  Zhuananid as 专案编号,CusShort as 客户,ProductName as 品名,AllMaterialQuantity as 用料数量,MAtStock as 存料分配,purchasequantity as 采购数量 from T_pur  where purchaseid='" + purchaseId + "'";

            ClientdataGridView1.DataSource =

                dbexe.getdataset(sql1, "T_pur").Tables[0];
            ClientdataGridView1.EnableHeadersVisualStyles               = false;
            ClientdataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 9, FontStyle.Bold);
            ClientdataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            ClientdataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 5
0
        private void frmBomAdd3_Load(object sender, EventArgs e)
        {
            string      BomidQuery  = "select top 1 bomid from t_bom order by bomid desc ";
            databaseexe databaseexe = new databaseexe();
            string      Bomid       = databaseexe.getTopselect(BomidQuery, "bomid");

            Bomid              = (int.Parse(Bomid) + 1).ToString();
            textBoxBoid1.Text  = Bomid;
            textBoxProId.Text  = dataValue.Bomid;
            textBoxLength.Text = dataValue.Bomlength;
            textBoxWide.Text   = dataValue.BomWide;
            textBoxHeight.Text = dataValue.Bomheight;
            string    productid = textBoxProId.Text.Trim();
            string    sql       = "select productName from T_bomall where id ='" + productid + "'";
            DataTable de        =
                dbexe.getdataset(sql, "T_bomall").Tables[0];

            for (int i = 0; i < de.Rows.Count; i++)
            {
                DataRow dc = de.Rows[i];
                textBoxProductName.Text = dc["productname"].ToString();
            }
            string    sql1 = "select quantity from T_bomall where id ='" + productid + "'";
            DataTable da   =
                dbexe.getdataset(sql1, "T_bomall").Tables[0];

            for (int i = 0; i < da.Rows.Count; i++)
            {
                DataRow dz = da.Rows[i];
                textBoxProQuantity.Text = dz["quantity"].ToString();
            }

            string    sql4 = "select MaterialId from T_material";
            DataTable dk   =
                dbexe.getdataset(sql4, " T_Material").Tables[0];

            for (int i = 0; i < dk.Rows.Count; i++)
            {
                DataRow dc = dk.Rows[i];
                BomNamecomboBox1.Items.Add(dc["materialID"]);
            }

            if (dk.Rows.Count > 0)
            {
                BomNamecomboBox1.SelectedIndex = -1;
            }

            string    sql5 = "select materialName from T_material where materialid='" + BomNamecomboBox1.Text.ToString() + "'";
            DataTable dm   =
                dbexe.getdataset(sql5, "T_material").Tables[0];

            for (int i = 0; i < dm.Rows.Count; i++)
            {
                DataRow dc = dm.Rows[i];
                textBoxBomname1.Text = dc["materialname"].ToString();
            }
        }
Esempio n. 6
0
        private void frmProductTypeAdd_Load(object sender, EventArgs e)
        {
            try
            {
                string sql = "select ProductDouble from T_productType where id ='" + textBoxID.Text.Trim() + "'";

                DataTable de =
                    dbexe.getdataset(sql, "T_productType").Tables[0];
                for (int i = 0; i < de.Rows.Count; i++)
                {
                    DataRow dc = de.Rows[i];
                    comboBoxDouble.Text = dc["ProductDouble"].ToString();
                }
                string sql1 = "select productDing from T_productType where id ='" + textBoxID.Text.Trim() + "'";

                DataTable da =
                    dbexe.getdataset(sql1, "T_productType").Tables[0];
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    DataRow db = da.Rows[i];
                    comboBoxDing.Text = db["productDing"].ToString();
                }
                string sql2 = "select Price from T_productType where id='" + textBoxID.Text.Trim() + "'";

                DataTable df =
                    dbexe.getdataset(sql2, "T_productType").Tables[0];
                for (int i = 0; i < df.Rows.Count; i++)
                {
                    DataRow dk = df.Rows[i];
                    textBoxPrice.Text = dk["Price"].ToString();
                }
                string sql3 = "select productLength from T_productType where id='" + textBoxID.Text.Trim() + "'";

                DataTable dz =
                    dbexe.getdataset(sql3, "T_productType").Tables[0];
                for (int i = 0; i < dz.Rows.Count; i++)
                {
                    DataRow dp = dz.Rows[i];
                    textBoxLong.Text = dp["productLength"].ToString();
                }
                string sql4 = "select productweight from T_productType where id='" + textBoxID.Text.Trim() + "'";

                DataTable di =
                    dbexe.getdataset(sql4, "T_productType").Tables[0];
                for (int i = 0; i < di.Rows.Count; i++)
                {
                    DataRow dj = di.Rows[i];
                    textBoxWeight.Text = dj["productweight"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 7
0
        private void frmMaterial_Load(object sender, EventArgs e)
        {
            MaterialdataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            string sql = "select MaterialId as 纸板编码,MaterialName as 纸板名称, MaterialType as 瓦楞类型 from T_material";

            MaterialdataGridView1.DataSource =
                dbexe.getdataset(sql, "T_material").Tables[0];
            MaterialdataGridView1.EnableHeadersVisualStyles               = false;
            MaterialdataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            MaterialdataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            MaterialdataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 8
0
        private void frmClient_Load(object sender, EventArgs e)
        {
            ClientdataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            string sql = "select CusID as 客户编码,CusShort as 客户简称, CusName as 客户全称, CusTelephone as 电话,CusFax as 传真,CusAdress as 地址,CusPerson as 联系人 from T_customer";

            ClientdataGridView1.DataSource =
                dbexe.getdataset(sql, "T_customer").Tables[0];
            ClientdataGridView1.EnableHeadersVisualStyles               = false;
            ClientdataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            ClientdataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            ClientdataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 9
0
        private void frmMatStock5_Load(object sender, EventArgs e)
        {
            MatStockdataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select Bomid as 编号,BomName AS 物料名称 ,BomSize as 物料规格,Stock as 当前库存 from T_bom ";

            MatStockdataGridView1.DataSource =
                dbexe.getdataset(sql, "T_matStock").Tables[0];
            MatStockdataGridView1.EnableHeadersVisualStyles               = false;
            MatStockdataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            MatStockdataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            MatStockdataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 10
0
        private void frmProductIn3_Load(object sender, EventArgs e)
        {
            DingdandataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select proinId as 入仓单号,zhuananid as 专案编号,CusShort as 客户,productName as 品名,producttYPE as 箱式,plength as 长,pwide as 宽,pheight as 高,unit as 单位,proinquantity as 入仓数量,proindate as 入仓日期 from T_proin where proinid is not null";

            DingdandataGridView1.DataSource =
                dbexe.getdataset(sql, "T_proin").Tables[0];
            DingdandataGridView1.EnableHeadersVisualStyles               = false;
            DingdandataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            DingdandataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            DingdandataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 11
0
        private void frmPurchaseManage4_Load(object sender, EventArgs e)
        {
            PurchasedataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select Purchaseid as 采购单号,id as 采购序号,supshort as 供方,materialname as 纸板名称,bomsize as 规格, purchasequantity as 数量,price as 单价,(price*purchasequantity) as 金额,deliverydate as 交货日期,purchasedate as 订购日期 from T_suppur where purchaseid is not null";

            PurchasedataGridView1.DataSource =
                dbexe.getdataset(sql, "T_suppur").Tables[0];
            PurchasedataGridView1.EnableHeadersVisualStyles               = false;
            PurchasedataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            PurchasedataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            PurchasedataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 12
0
        private void frmDingdan_Load(object sender, EventArgs e)
        {
            DingdandataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select Cusshort as 客户,orderid AS 订单号 ,id as 专案编号, Productname as 品名, producttype as 箱式,materialname as 纸板名称 ,plength as 长,pwide as 宽,pheight as 高, unit as 单位 from T_alls ";

            DingdandataGridView1.DataSource =
                dbexe.getdataset(sql, "T_salls").Tables[0];
            DingdandataGridView1.EnableHeadersVisualStyles               = false;
            DingdandataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            DingdandataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            DingdandataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 13
0
        private void frmSupplier_Load(object sender, EventArgs e)
        {
            SupplierdataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select SupId as 供方编码,SupShort as 供方简称, SupName as 供方全称, SupTelephone as 电话,SupFax as 传真,SupAdress as 地址,SupPerson as 负责人 from T_Supplier ";

            SupplierdataGridView.DataSource =
                dbexe.getdataset(sql, "T_supplier").Tables[0];
            SupplierdataGridView.EnableHeadersVisualStyles               = false;
            SupplierdataGridView.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            SupplierdataGridView.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            SupplierdataGridView.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 14
0
        private void frmDeliveryManage5_Load(object sender, EventArgs e)
        {
            DeliverydataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select DeliveryID as 送货单号,deliveryindate AS 出货日期 ,zhuananid as 专案编号, Productname as 品名, producttype as 箱式,materialname as 纸板名称 ,plength as 长,pwide as 宽,pheight as 高, unit as 单位,deliveryoutquantity as 出货数量,carperson as 车号 from T_DelOut where deliveryid is not null ";

            DeliverydataGridView1.DataSource =
                dbexe.getdataset(sql, "T_DelOut").Tables[0];
            DeliverydataGridView1.EnableHeadersVisualStyles               = false;
            DeliverydataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            DeliverydataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            DeliverydataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 15
0
        private void frmMaterialIn4_Load(object sender, EventArgs e)
        {
            MaterialIndataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select MatinId as 入仓单号,id as 采购序号,SupShort as 供方,MaterialName as 纸板,BomSize as 规格,MatinQuantity as 数量,MatDate as 入仓日期,deliveryDate as 交期 from T_Matin2 where Matinid is not null";

            MaterialIndataGridView1.DataSource =
                dbexe.getdataset(sql, "T_matin2").Tables[0];
            MaterialIndataGridView1.EnableHeadersVisualStyles               = false;
            MaterialIndataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            MaterialIndataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            MaterialIndataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 16
0
        private void frmProductType_Load(object sender, EventArgs e)
        {
            TypedataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select Id as 编码,TypeName as 种类名称 from T_productType ";

            TypedataGridView1.DataSource =
                dbexe.getdataset(sql, "T_productType").Tables[0];
            TypedataGridView1.EnableHeadersVisualStyles               = false;
            TypedataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            TypedataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            TypedataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 17
0
        private void buttonRefresh_Click(object sender, EventArgs e)
        {
            string sql = "select ManuId as 生产单号,ZhuanAnid as 专案编号,CusShort as 客户,productName as 品名,productType as 箱式,plength as 长,pwide as 宽,pheight as 高,unit as 单位,orderQuantity as 订单数量,materialName as 纸板名称,BomSize as 纸板尺寸,allmaterialQuantity as 张数 from T_manus where id is not null";

            ManudataGridView1.DataSource =
                dbexe.getdataset(sql, "T_manus").Tables[0];
        }
Esempio n. 18
0
 private void buttonSearch_Click(object sender, EventArgs e)
 {
     try
     {
         Connstr     connstr = new Connstr();
         databaseexe dbexe   = new databaseexe();
         string      ProName = textBoxName.Text.Trim();
         string      sql     = "select id as 编码,productName as 品名,productType as 箱式,PLength as 长,Pwide as 宽,Pheight as 高,unit as 单位, Price as 单价  from T_fixpro where fatherid is null and CusId ='" + Cid + "'and productname like'%" + ProName + "%'";
         //string sql = "select CusID as 客户编码,CusShort as 客户简称, CusName as 客户全称, CusTelephone as 电话,CusFax as 传真,CusAdress as 地址,CusPerson as 联系人 from T_customer where CusId like'%" + CusId + "%'";
         DataTable dt =
             dbexe.getdataset(sql, "T_T_fixpro").Tables[0];
         ProductdataGridView2.DataSource = dt;
         if (dt.Rows.Count == 0)
         {
             MessageBox.Show("没有符合条件的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             //buttonModify.Enabled = false;
             textBoxName.Clear();
         }
         else
         {
             MessageBox.Show("查询到:" + dt.Rows.Count + " 条记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             //buttonModify.Enabled = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 19
0
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult dialogresult = MessageBox.Show("您确定要删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dialogresult == DialogResult.No)
         {
             return;
         }
         else
         {
             databaseexe dbexe  = new databaseexe();
             string      PairID = PairListdataGridView.SelectedRows[0].Cells["编码"].Value.ToString();
             string      sql    = "delete from T_fixpro where ID='" + PairID + "'";
             dbexe.sqlcmd(sql);
             MessageBox.Show("数据删除成功!");
             PairListdataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
             string sql1 = "select id as 编码, productname as 名称,producttype as 纸箱种类, materialname as 纸板材质,plength as 长,pwide as 宽,pheight as 高,unit as 单位,quantity as 数量 from T_fixpro where fatherId='" + fatherId + "'";
             PairListdataGridView.DataSource =
                 dbexe.getdataset(sql1, "T_fixpro").Tables[0];
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 20
0
        public void dgload(string Manuorderid, string ManuId)
        {
            ManudataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            string sql = "select zhuananId as 专案编码, Productname as 品名, producttype as 箱式," +
                         "materialname as 纸板名称 ,plength as 长,pwide as 宽,pheight as 高,unit as 单位,Bomsize as 用料," +
                         "allMaterialQuantity as 张数 from T_manus where orderid= '" + Manuorderid + "'";

            ManudataGridView1.DataSource =
                dbexe.getdataset(sql, "T_manus").Tables[0];
            ManudataGridView1.EnableHeadersVisualStyles               = false;
            ManudataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            ManudataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            ManudataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            databaseexe databaseexe = new databaseexe();

            textBoxSaleID.Text = Manuorderid;
            textBoxManuId.Text = ManuId;
            string CusidQuery = "select distinct(Cusid) from T_allsale where orderid='" + Manuorderid + "'";
            string da         = databaseexe.getTopselect(CusidQuery, "Cusid");

            textBoxCusid.Text = da;
            string CusShortQuery = "select CusShort from T_Customer where Cusid='" + da + "'";

            textBoxCusshort.Text = databaseexe.getTopselect(CusShortQuery, "CusShort");
            string OrderDateQuery = "select distinct(orderDate) from T_allSale where Orderid='" + Manuorderid + "'";

            textBoxOrderdate.Text = databaseexe.getTopselect(OrderDateQuery, "OrderDate");
            string DeliveryDateQuery = "select distinct(Deliverytime) from T_allSale where orderid='" + Manuorderid + "'";

            textBoxDeliveryDate.Text = databaseexe.getTopselect(DeliveryDateQuery, "deliverytime");
        }
Esempio n. 21
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (i > 2)
            {
                MessageBox.Show("您已经密码错误了2次,不能登录");
                textBox1.Clear();
                textBox2.Clear();
                timer1.Enabled = true;
                btnOK.Enabled  = false;
                timer2.Enabled = true;
                return;
            }
            string yhm = textBox1.Text.ToString().Trim();
            string mm  = textBox2.Text.ToString().Trim();
            string yzm = textBox3.Text.ToString().Trim();

            dataValue.UserName = yhm;
            dataValue.Password = mm;
            string      sql2         = "select * from T_member where jobno='" + yhm + "' ";
            databaseexe databaseexe1 = new databaseexe();

            dataValue.StaffName = databaseexe1.getTopName(sql2);
            if (yhm == "")
            {
                MessageBox.Show("用户名不能为空!");
            }
            else
            {
                Connstr       connstr = new Connstr();
                SqlConnection conn    = connstr.getcon();
                string        sql     = "select * from T_user where username='******' and password='******' ";
                SqlCommand    cmd     = new SqlCommand(sql, conn);
                SqlDataReader dr      = cmd.ExecuteReader();
                if (dr.Read())
                {
                    MessageBox.Show("登陆成功");
                    databaseexe dbexe = new databaseexe();
                    string      sql1  = "select jobname from T_Member where jobNo='" + yhm + "'";
                    DataTable   de    =
                        dbexe.getdataset(sql1, "T_member").Tables[0];
                    for (int i = 0; i < de.Rows.Count; i++)
                    {
                        DataRow dc = de.Rows[i];
                        dataValue.StaffName = dc["jobname"].ToString();
                    }
                    FrmMain mainform = new FrmMain();
                    mainform.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("用户名或密码错误!");
                    textBox1.Clear();
                    textBox2.Clear();
                    i++;
                }
            }
        }
Esempio n. 22
0
 private void frmPairList_Load(object sender, EventArgs e)
 {
     PairListdataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
     try
     {
         string sql = "select id as 编码, productname as 名称,producttype as 纸箱种类, materialname as 纸板材质,plength as 长,pwide as 宽,pheight as 高,unit as 单位,quantity as 数量 from T_fixpro where fatherId='" + fatherId + "'";
         PairListdataGridView.DataSource =
             dbexe.getdataset(sql, "T_Fixpro").Tables[0];
         PairListdataGridView.EnableHeadersVisualStyles               = false;
         PairListdataGridView.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
         PairListdataGridView.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
         PairListdataGridView.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 23
0
 private void frmFixProduct_Load(object sender, EventArgs e)
 {
     try
     {
         FixProductGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
         string sql = "select id as 编码,ProductName as 品名,productType as 箱式,MaterialName as 材料名称,PLength as 长,Pwide as 宽,Pheight as 高,unit as 单位, Price as 单价  from T_FixPRO where fatherid is null and CusId ='" + Id + "'";
         FixProductGridView1.DataSource =
             dbexe.getdataset(sql, "T_FixPRO").Tables[0];
         FixProductGridView1.EnableHeadersVisualStyles               = false;
         FixProductGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
         FixProductGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
         FixProductGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 24
0
        private void frmMatCho4_Load(object sender, EventArgs e)
        {
            MatInGenerator matIn = new MatInGenerator();

            MatInID = matIn.MatinGenerator();

            string    SupQuery = "select SupShort from T_Supplier";
            DataTable dk       =
                dbexe.getdataset(SupQuery, " T_supplier").Tables[0];

            for (int i = 0; i < dk.Rows.Count; i++)
            {
                DataRow dc = dk.Rows[i];
                comboBox1.Items.Add(dc["supShort"]);
            }

            if (dk.Rows.Count > 0)
            {
                comboBox1.SelectedIndex = -1;
            }

            // PurchaseGenerator pur = new PurchaseGenerator();
            //PurchaseId = pur.purchaseGenerator();

            /*ChooseProductGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
             * string sql = "select SupShort as 供方,purid as 采购序号,MaterialName as 纸板名称,bomsize as 规格,PurchaseQuantity as 采购数量,MatQuantity as 进料数量,(purchaseQuantity-matquantity)as 未进数量,PurchaseDate as 订货日期,deliverydate as 交货日期 from T_Matin2 where id is null and purid is not null and purchaseQuantity <> '0'";
             *
             * DataTable Datatable;
             * Datatable = dbexe.getdataset(sql, "T_MATin2").Tables[0];
             * for (int i = 0; i < Datatable.Rows.Count; i++) {
             *  if (Datatable.Rows[i]["进料数量"].ToString() == "") {
             *      Datatable.Rows[i]["进料数量"] = "0";
             *      Datatable.Rows[i]["未进数量"] = Datatable.Rows[i]["采购数量"];
             *  }
             * }
             * ChooseProductGridView1.DataSource = Datatable;
             * ChooseProductGridView1.EnableHeadersVisualStyles = false;
             * ChooseProductGridView1.ColumnHeadersDefaultCellStyle.Font = new Font("宋体", 11, FontStyle.Bold);
             * ChooseProductGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
             * ChooseProductGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;*/
        }
Esempio n. 25
0
        public void dgload(string supid, string matinid, string purid)
        {
            textBoxProductInId.Text = matinid;

            //textBoxSup.Text = supid;
            string      SupShortQuery = "select SupShort from t_Supplier where Supid='" + supid + "'";
            databaseexe databaseexe   = new databaseexe();

            textBoxSup.Text = databaseexe.getTopselect(SupShortQuery, "Supshort");
            MaterialIndataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select purid as 采购序号,Supshort as 供方,MaterialName as 纸板,bomsize as 规格,MatQuantity as 数量,price as 单价,MatQuantity*price as 金额 from T_Matin2 where Matinid='" + matinid + "'";



            DataTable datatable = dbexe.getdataset(sql, "T_matin2").Tables[0];

            for (int i = 0; i < datatable.Rows.Count; i++)
            {
                datatable.Rows[i]["数量"] = "0";
            }
            MaterialIndataGridView1.DataSource = datatable;
            MaterialIndataGridView1.EnableHeadersVisualStyles               = false;
            MaterialIndataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 9, FontStyle.Bold);
            MaterialIndataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            MaterialIndataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

            string quantityNow = dataValue.CurrentQuantity;

            ClientdataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            string sql1 = "select Zhuananid as 专案编号,CusShort as 客户,ProductName as 品名,purchaseQuantity as 采购数量,Matquantity as 入仓数量 from T_matin3  where matinid = '" + textBoxProductInId.Text.ToString() + "'";

            ClientdataGridView1.DataSource =

                dbexe.getdataset(sql1, "T_matin3").Tables[0];
            ClientdataGridView1.EnableHeadersVisualStyles               = false;
            ClientdataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 9, FontStyle.Bold);
            ClientdataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            ClientdataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 26
0
        private void DeliverydataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            string zhuananid    = DeliverydataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
            string changestring = DeliverydataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
            string deliveryId   = textBoxDeliveryID.Text.ToString();

            try
            {
                databaseexe databaseexe = new databaseexe();
                //string QuantityNow = ClientdataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString();
                //int CurrentQuantity = int.Parse(QuantityNow) + int.Parse(changestring);

                string QuantityQuery   = "select sum(deliveryoutquantity) as a from T_deliveryOut group by zhuananID having sum(deliveryoutquantity)is not null and zhuananID='" + zhuananid + "'";
                string lastQuantity    = databaseexe.getTopselect(QuantityQuery, "a");
                int    CurrentQuantity = int.Parse(lastQuantity) + int.Parse(changestring);
                string sql             = "update T_deliveryOut set deliveryoutquantity ='" + changestring + "',deliveryquantity ='" + CurrentQuantity + "'where zhuananid ='" + zhuananid + "'and deliveryid='" + textBoxDeliveryID.Text.ToString() + "'";
                databaseexe.sqlcmd(sql);
                this.BeginInvoke(new MethodInvoker(() => {//异步处理
                    string sql1 = "select CusShort as 客户,zhuananid as 专案编号,productName as 品名,productType as 箱式,materialName as 纸板名称,plength as 长,pwide as 宽,pheight as 高,unit as 单位,deliveryoutquantity as 出货数量,price as 单价,(deliveryOutquantity*price) as 金额 from T_DelOut where deliveryid='" + deliveryId + "'";

                    //DeliverydataGridView1.DataSource =

                    //dbexe.getdataset(sql1, "T_delout").Tables[0];
                    //string sql = "select CusShort as 客户,zhuananid as 专案编号,Orderid as 订单号,productName as 品名,producttYPE as 箱式,plength as 长,pwide as 宽,pheight as 高,unit as 单位,materialName as 纸板名称,orderquantity as 订单数量, deliveryquantity as 已送数量,(orderquantity-deliveryquantity)as 未送数量,deliverytime as 交货日期 from T_delout where id is null and zhuananid is not null or id  in(select max(id) from T_delout group by zhuananid having max(id)is not null )";

                    DataTable Datatable;
                    Datatable = dbexe.getdataset(sql1, "T_DelOut").Tables[0];

                    DeliverydataGridView1.DataSource = Datatable;
                }));
                this.BeginInvoke(new MethodInvoker(() => {
                    string MatStock = "Update T_fixpro set Stock=Stock-'" + changestring + "' where id=(select pid from T_alls where id='" + zhuananid + "')";
                    dbexe.sqlcmd(MatStock);
                }));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 27
0
        //string AllMaterialQuery = " Select unitquantity*orderquantity as a from T_manus where ZhuanAnID = '" + arr[i].ToString() + "'";
        //string AllMaterialQuantity = databaseexe.getTopselect(AllMaterialQuery, "a");
        private void frmPurchaseChoose4_Load(object sender, EventArgs e)
        {
            PurchaseGenerator pur = new PurchaseGenerator();

            PurchaseId = pur.purchaseGenerator();
            PurchaseOrderdataGridView2.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            string sql = "select zhuananid as 专案编号,CusShort as 客户,productName as 品名," +
                         "materialName as 纸板名称,bomsize as 规格, allMaterialQuantity-matstock as 欠料数量" +
                         " from T_pur where purchaseid is null and manuid is not null ";
            DataTable Datatable;

            Datatable = dbexe.getdataset(sql, "T_pur").Tables[0];
            for (int i = 0; i < Datatable.Rows.Count; i++)
            {
                if (int.Parse(Datatable.Rows[i]["欠料数量"].ToString()) < 0)
                {
                    Datatable.Rows[i]["欠料数量"] = "0";
                }
            }
            PurchaseOrderdataGridView2.DataSource = Datatable;
            PurchaseOrderdataGridView2.EnableHeadersVisualStyles               = false;
            PurchaseOrderdataGridView2.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            PurchaseOrderdataGridView2.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            PurchaseOrderdataGridView2.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 28
0
        private void frmBom3_Load(object sender, EventArgs e)
        {
            BomGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select id as 产品编码,productname as 产品名称,plength as 长,pwide as 宽,pheight as 高 from T_BomAll ";

            BomGridView1.DataSource =
                dbexe.getdataset(sql, "T_bomall").Tables[0];
            BomGridView1.EnableHeadersVisualStyles               = false;
            BomGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            BomGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            BomGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 29
0
        private void frmSaleSearch3_Load(object sender, EventArgs e)
        {
            SaleOrderdataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select Orderid as 订单号,zhuananID as 专案编号,productName as 普通纸箱,materialName as 纸板名称,producttype as 箱式,plength as 订单长,pwide as 订单宽,pheight as 订单高,unit as 单位,price as 单价,orderquantity as 订单数量 from T_manu where id is null and status ='已审核' ";

            SaleOrderdataGridView1.DataSource =
                dbexe.getdataset(sql, "T_manu").Tables[0];
            SaleOrderdataGridView1.EnableHeadersVisualStyles               = false;
            SaleOrderdataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            SaleOrderdataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            SaleOrderdataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }
Esempio n. 30
0
        private void frmProStock5_Load(object sender, EventArgs e)
        {
            ProStockdataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            string sql = "select id as 编号,Cusid as 客户,productName AS 品名, plength as 长,pwide as 宽,pheight as 高,unit as 单位,stock as 当前库存 from T_fixpro ";

            ProStockdataGridView1.DataSource =
                dbexe.getdataset(sql, "T_fixpro").Tables[0];
            ProStockdataGridView1.EnableHeadersVisualStyles               = false;
            ProStockdataGridView1.ColumnHeadersDefaultCellStyle.Font      = new Font("宋体", 11, FontStyle.Bold);
            ProStockdataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSlateGray;
            ProStockdataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
        }