Example #1
0
        public int tb_JhGoodsInfoMenthodUpdate(tb_JhGoodsInfo tbGood)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "update tb_JhGoodsInfo set ";
                str_Add += "EmpId='" + tbGood.strEmpId + "',JhCompName='" + tbGood.strJhCompName + "',";
                str_Add += "DepotName='" + tbGood.strDepotName + "',GoodsName='" + tbGood.strGoodsName + "',GoodsNum='" + tbGood.strGoodsNum + "',";
                str_Add += "GoodsUnit='" + tbGood.strGoodsUnit + "',GoodsJhPrice='" + tbGood.deGoodsJhPrice + "' ,GoodsSellPrice='" + tbGood.deGoodsSellPrice + "' ,";
                str_Add += "GoodsNeedPrice='" + tbGood.deGoodsNeedPrice + "',GoodsNoPrice='" + tbGood.deGoodsNoPrice + "',GoodsRemark='" + tbGood.strGoodsRemark + "',";
                str_Add += "GoodTime='" + tbGood.DaGoodTime + "',Falg='" + tbGood.Falg + "' where GoodsID ='" + tbGood.strGoodsID + "'";
                getSqlConnection getConnection = new getSqlConnection();
                conn    = getConnection.GetCon();
                cmd     = new SqlCommand(str_Add, conn);
                intFalg = cmd.ExecuteNonQuery();
                conn.Dispose();


                tb_KcGoods        kc  = new tb_KcGoods(tbGood.strGoodsID, tbGood.strJhCompName, tbGood.strDepotName, tbGood.strGoodsName, tbGood.strGoodsNum, 0, tbGood.strGoodsUnit, tbGood.DaGoodTime, tbGood.deGoodsJhPrice, tbGood.deGoodsSellPrice, tbGood.strEmpId, "");
                tb_KcGoodsMenthod kc1 = new tb_KcGoodsMenthod();
                kc1.tb_KcGoodsUpdate(kc);

                return(intFalg);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
        public int tb_KcGoodsUpdate(tb_KcGoods kcGood)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "update tb_KcGoods set  ";
                str_Add += "KcDeptName='" + kcGood.strKcDeptName + "',KcNum=" + kcGood.intKcNum + ",";
                str_Add += "KcAlarmNum=" + kcGood.intKcAlarmNum + ",KcTime='" + kcGood.daKcTime + "',";
                str_Add += "KcGoodsPrice=" + kcGood.deKcGoodsPrice + ",KcSellPrice=" + kcGood.deKcSellPrice + ",KcEmp='" + kcGood.strKcEmp + "',";
                str_Add += "KcRemark='" + kcGood.strKcRemark + "' where GoodsID ='" + kcGood.strGoodsID + "'";

                getSqlConnection getConnection = new getSqlConnection();
                conn    = getConnection.GetCon();
                cmd     = new SqlCommand(str_Add, conn);
                intFalg = cmd.ExecuteNonQuery();
                conn.Dispose();
                return(intFalg);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
        public int tb_KcGoodsAdd(tb_KcGoods kcGood)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "insert into tb_KcGoods values( ";
                str_Add += "'" + kcGood.strGoodsID + "','" + kcGood.strJhCompName + "',";
                str_Add += "'" + kcGood.strKcDeptName + "','" + kcGood.strKcGoodsName + "'," + kcGood.intKcNum + ",";
                str_Add += "" + kcGood.intKcAlarmNum + ",'" + kcGood.intKcUnit + "','" + kcGood.daKcTime + "',";
                str_Add += "" + kcGood.deKcGoodsPrice + "," + kcGood.deKcSellPrice + ",'" + kcGood.strKcEmp + "',";
                str_Add += "'" + kcGood.strKcRemark + "')";

                getSqlConnection getConnection = new getSqlConnection();
                conn    = getConnection.GetCon();
                cmd     = new SqlCommand(str_Add, conn);
                intFalg = cmd.ExecuteNonQuery();
                conn.Dispose();

                return(intFalg);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
Example #4
0
 public void tb_ThGoodsFind(object DataObject, int intFalg, tb_KcGoods kcGood)
 {
 }
Example #5
0
        public int tb_KcGoodsUpdate(tb_KcGoods kcGood)
        {
            int intFalg = 0;

            return(intFalg);
        }
Example #6
0
        public int tb_KcGoodsAdd(tb_KcGoods kcGood)
        {
            int intFalg = 0;

            return(intFalg);
        }
        public void tb_ThGoodsFind(object DataObject, int intFalg, tb_KcGoods kcGood)
        {
            int    intCount = 0;
            string strSecar = null;

            try
            {
                switch (intFalg)
                {
                case 1:
                    strSecar = "select * from tb_KcGoods where GoodsID  like '%" + kcGood.strGoodsID + "%'";
                    break;

                case 2:
                    strSecar = "select * from tb_KcGoods  where KcGoodsName like '%" + kcGood.strKcGoodsName + "%'";
                    break;

                case 4:
                    strSecar = "select * from tb_KcGoods ";
                    break;
                }

                getSqlConnection getConnection = new getSqlConnection();
                conn = getConnection.GetCon();
                cmd  = new SqlCommand(strSecar, conn);
                int ii = 0;
                qlddr = cmd.ExecuteReader();
                while (qlddr.Read())
                {
                    ii++;
                }
                qlddr.Close();


                System.Windows.Forms.DataGridView dv = (DataGridView)DataObject;

                if (ii != 0)
                {
                    int i = 0;
                    dv.RowCount = ii;
                    qlddr       = cmd.ExecuteReader();
                    while (qlddr.Read())
                    {
                        dv[0, i].Value = qlddr[1].ToString();
                        dv[1, i].Value = qlddr[4].ToString();
                        dv[2, i].Value = qlddr[3].ToString();
                        dv[3, i].Value = qlddr[5].ToString();
                        dv[4, i].Value = qlddr[6].ToString();
                        i++;
                    }
                    qlddr.Close();
                }
                else
                {
                    if (dv.RowCount != 0)
                    {
                        int i = 0;
                        do
                        {
                            dv[0, i].Value = "";
                            dv[1, i].Value = "";
                            dv[2, i].Value = "";
                            dv[3, i].Value = "";
                            dv[4, i].Value = "";
                            i++;
                        } while (i < dv.RowCount);
                    }
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
            }
        }