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);
            }
        }
Beispiel #2
0
        public int tb_EmpInfoUpdate(tb_EmpInfo Empinfo)
        {
            int intFalg = 0;

            try
            {
                string str_Update = "update tb_EmpInfo set ";
                str_Update += "EmpName='" + Empinfo.strEmpName + "',EmpLoginName='" + Empinfo.strEmpLoginName + "',";
                str_Update += "EmpLoginPwd='" + Empinfo.strEmpLoginPwd + "',EmpSex='" + Empinfo.intEmpSex + "',EmpBirthday='" + Empinfo.daEmpBirthday + "',";
                str_Update += "EmpDept= '" + Empinfo.strEmpDept + "',EmpPost='" + Empinfo.strEmpPost + "',EmpPhone='" + Empinfo.strEmpPhone + "',";
                str_Update += " EmpPhoneM='" + Empinfo.strEmpPhoneM + "',EmpAddress='" + Empinfo.strEmpAddress + "',";
                str_Update += "EmpFalg=" + Empinfo.intEmpFalg + " where  EmpId='" + Empinfo.intEmpId + "'";
                getSqlConnection getConnection = new getSqlConnection();
                conn    = getConnection.GetCon();
                cmd     = new SqlCommand(str_Update, 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);
            }
        }
Beispiel #4
0
        public void filltProd(object objTreeView, object obimage)
        {
            try
            {
                getSqlConnection getConnection = new getSqlConnection();
                conn = getConnection.GetCon();
                string strSecar = "select * from tb_SellGoods ";
                cmd   = new SqlCommand(strSecar, conn);
                qlddr = cmd.ExecuteReader();

                if (objTreeView.GetType().ToString() == "System.Windows.Forms.TreeView")
                {
                    System.Windows.Forms.ImageList imlist = (System.Windows.Forms.ImageList)obimage;

                    System.Windows.Forms.TreeView TV = (System.Windows.Forms.TreeView)objTreeView;
                    TV.Nodes.Clear();

                    TV.ImageList = imlist;
                    System.Windows.Forms.TreeNode TN = TV.Nodes.Add("A", "商品销售信息", 0, 1);

                    while (qlddr.Read())
                    {
                        TreeNode newNode12 = new TreeNode(qlddr[0].ToString(), 0, 1);
                        newNode12.Nodes.Add("A", qlddr[4].ToString(), 0, 1);
                        TN.Nodes.Add(newNode12);
                    }
                    qlddr.Close();
                    TV.ExpandAll();
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
            }
        }
Beispiel #5
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();
                return(intFalg);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
Beispiel #6
0
        public int tb_CompanyMenthodUpDate(tb_Company Company)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "update tb_Company  set ";
                str_Add += "CompanyName='" + Company.strCompanyName + "',CompanyDirector='" + Company.strCompanyDirector + "',";
                str_Add += "CompanyPhone='" + Company.strCompanyPhone + "',CompanyFax='" + Company.strCompanyFax + "',CompanyAddress='" + Company.strCompanyAddress + "',";
                str_Add += "Falg='" + Company.intEmpFalg + "' where CompanyID ='" + Company.intCompanyID + "'";


                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_JhGoodsInfoMenthodAdd(tb_JhGoodsInfo tbGood)
        {
            int intFalg = 0;

            try
            {
                //string str_Add = "insert into tb_JhGoodsInfo values( ";
                //str_Add += "'" + tbGood.strGoodsID + "','" + tbGood.strEmpId + "','" + tbGood.strJhCompName + "',";
                //str_Add += "'" + tbGood.strDepotName + "','" + tbGood.strGoodsName + "','" + tbGood.strGoodsNum + "',";
                //str_Add += "'" + tbGood.strGoodsUnit + "','" + tbGood.deGoodsJhPrice + "','" + tbGood.deGoodsSellPrice + "',";
                //str_Add += "'" + tbGood.deGoodsNeedPrice + "','" + tbGood.deGoodsNoPrice + "','" + tbGood.strGoodsRemark + "',";
                //str_Add += "'" + tbGood.Falg + "')";
                string str_Add = "insert into tb_JhGoodsInfo values( ";
                str_Add += "'" + tbGood.strGoodsID + "','" + tbGood.strEmpId + "','" + tbGood.strJhCompName + "',";
                str_Add += "'" + tbGood.strDepotName + "','" + tbGood.strGoodsName + "','" + tbGood.strGoodsNum + "',";
                str_Add += "'" + tbGood.strGoodsUnit + "'," + tbGood.deGoodsJhPrice + " ," + tbGood.deGoodsSellPrice + " ,";
                str_Add += "" + tbGood.deGoodsNeedPrice + "," + tbGood.deGoodsNoPrice + ",'" + tbGood.strGoodsRemark + "',";
                str_Add += "'" + tbGood.DaGoodTime + "'," + tbGood.Falg + ")";
                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);
            }
        }
Beispiel #8
0
        public SqlDataReader tb_JhGoodsInfoFind(string strObject, int intFalg)
        {
            int    intCount = 0;
            string strSecar = null;

            try
            {
                switch (intFalg) //判断条件
                {
                case 1:          //"编号查
                    strSecar = "select * from tb_JhGoodsInfo where GoodsID = '" + strObject + "' and Falg=0";
                    break;

                case 2:   //全部果询
                    strSecar = "select  * from  tb_JhGoodsInfo  where Falg=0";
                    break;
                }
                getSqlConnection getConnection = new getSqlConnection();
                conn  = getConnection.GetCon();
                cmd   = new SqlCommand(strSecar, conn);
                qlddr = cmd.ExecuteReader();
                return(qlddr);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());

                return(qlddr);
            }
        }
Beispiel #9
0
        public int tb_SellGoodsUpdate(tb_SellGoods tbChGood)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "update tb_SellGoods set ";
                str_Add += "KcID='" + tbChGood.strKcID + "',GoodsID='" + tbChGood.strGoodsID + "',";
                str_Add += "EmpId='" + tbChGood.strEmpId + "',GoodsName='" + tbChGood.strGoodsName + "',SellGoodsNum=" + tbChGood.strSellGoodsNum + ",";
                str_Add += "SellGoodsTime='" + tbChGood.daSellGoodsTime + "',SellPrice=" + tbChGood.deSellPrice + ",";
                str_Add += "SellNeedPay=" + tbChGood.deSellNeedPay + ",SellHasPay=" + tbChGood.deSellHasPay + ",SellRemark='" + tbChGood.strSellRemark + "',SellFalg=" + tbChGood.intSellFalg + "";
                str_Add += " where  SellID= '" + tbChGood.strSellID + "'";

                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);
            }
        }
Beispiel #10
0
        public int tb_EmpInfoAdd(tb_EmpInfo Empinfo)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "insert into tb_EmpInfo values( ";
                str_Add += " '" + Empinfo.intEmpId + "','" + Empinfo.strEmpName + "','" + Empinfo.strEmpLoginName + "',";
                str_Add += " '" + Empinfo.strEmpLoginPwd + "','" + Empinfo.intEmpSex + "','" + Empinfo.daEmpBirthday + "',";
                str_Add += " '" + Empinfo.strEmpDept + "','" + Empinfo.strEmpPost + "','" + Empinfo.strEmpPhone + "',";
                str_Add += " '" + Empinfo.strEmpPhoneM + "','" + Empinfo.strEmpAddress + "',";
                str_Add += "" + Empinfo.intEmpFalg + ")";
                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);
            }
        }
Beispiel #11
0
        }// end fi

        #endregion
        public string fillfrmKcGoods(string strID)
        {
            string SID = "";

            try
            {
                string strSecar = "select kcid from tb_KcGoods  where GoodsID ='" + strID + "'";

                getSqlConnection getConnection = new getSqlConnection();
                conn  = getConnection.GetCon();
                cmd   = new SqlCommand(strSecar, conn);
                qlddr = cmd.ExecuteReader();
                qlddr.Read();
                if (qlddr.HasRows)
                {
                    SID = qlddr[0].ToString();
                }
                qlddr.Close();
                return(SID);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message.ToString());
                return(SID);
            }
        }
Beispiel #12
0
        }// end if

        #endregion
        #region //填冲商品类别信息 TrreView控件
        public void filltProd(object objTreeView, object obimage)
        {
            try
            {
                getSqlConnection getConnection = new getSqlConnection();
                conn = getConnection.GetCon();
                string strSecar = "select * from tb_Company  where Falg=0";
                cmd   = new SqlCommand(strSecar, conn);
                qlddr = cmd.ExecuteReader();

                if (objTreeView.GetType().ToString() == "System.Windows.Forms.TreeView")
                {
                    System.Windows.Forms.ImageList imlist = (System.Windows.Forms.ImageList)obimage;

                    System.Windows.Forms.TreeView TV = (System.Windows.Forms.TreeView)objTreeView;
                    TV.Nodes.Clear();

                    TV.ImageList = imlist;
                    System.Windows.Forms.TreeNode TN = new System.Windows.Forms.TreeNode("供应商名称", 0, 1);
                    while (qlddr.Read())
                    {
                        TN.Nodes.Add("", qlddr[1].ToString(), 0, 1);
                    }
                    TV.Nodes.Add(TN);
                    qlddr.Close();
                    TV.ExpandAll();
                }
            }//
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
            }
        }// end fi
Beispiel #13
0
        public SqlDataReader tb_EmpInfoFind(string strObject, int intFalg)
        {
            int    intCount = 0;
            string strSecar = null;

            try
            {
                switch (intFalg)
                {
                case 1:
                    strSecar = "select * from tb_EmpInfo where EmpId= '" + strObject + "' and EmpFalg=0";
                    break;

                case 2:
                    strSecar = "select * from tb_EmpInfo where EmpFalg=0";
                    break;
                }
                strSecar = "select * from tb_EmpInfo where EmpId= '" + strObject + "' and EmpFalg=0";

                getSqlConnection getConnection = new getSqlConnection();
                conn = getConnection.GetCon();
                cmd  = new SqlCommand(strSecar, conn);

                qlddr = cmd.ExecuteReader();


                return(qlddr);
            }
            catch (Exception ee)
            {
                return(qlddr);
            }
        }
        public int tb_KcGoodsUpdate(string kcGood, int striID)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "update tb_KcGoods set  ";

                str_Add += "KcAlarmNum=" + striID + " ";

                str_Add += " where GoodsID ='" + kcGood + "'";

                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);
            }
        }
Beispiel #15
0
        public int tb_ThGoodsUpdate(tb_ThGoodsInfo tbChGood)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "update tb_ThGoodsInfo set ";
                str_Add += "KcID='" + tbChGood.strKcID + "',GoodsID='" + tbChGood.strGoodsID + "',";
                str_Add += "SellID='" + tbChGood.strSellID + "',EmpId='" + tbChGood.intEmpId + "',ThGoodsName='" + tbChGood.strThGoodsName + "',";
                str_Add += "ThGoodsNum=" + tbChGood.intThGoodsNum + ",ThGoodsTime='" + tbChGood.daThGoodsTime + "',ThGoodsPrice=" + tbChGood.deThGoodsPrice + ",";
                str_Add += "ThHasPay=" + tbChGood.deThHasPay + ",ThNeedPay=" + tbChGood.deThNeedPay + ",ThGoodsResult='" + tbChGood.deThGoodsResult + "' where  ThGoodsID='" + tbChGood.strThGoodsID + "'";


                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);
            }
        }
Beispiel #16
0
        }// end if

        #endregion
        #region 查询
        public void tb_ThGoodsFind(Object DataObject)
        {
            int    intCount = 0;
            string strSecar = null;

            try
            {
                strSecar = "select * from tb_ThGoodsInfo ";
                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[0].ToString();
                        dv[1, i].Value = qlddr[3].ToString();
                        dv[2, i].Value = qlddr[5].ToString();
                        dv[3, i].Value = qlddr[8].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 = "";
                            i++;
                        } while (i < dv.RowCount);
                    }
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
            }
        }
Beispiel #17
0
        public int tb_EmpInfoDelete(tb_EmpInfo Empinfo)
        {
            int intFalg = 0;

            try
            {
                string str_Update = "update tb_EmpInfo set ";
                str_Update += "EmpFalg='" + Empinfo.intEmpFalg + "' where  EmpId='" + Empinfo.intEmpId + "'";
                getSqlConnection getConnection = new getSqlConnection();
                conn    = getConnection.GetCon();
                cmd     = new SqlCommand(str_Update, conn);
                intFalg = cmd.ExecuteNonQuery();
                conn.Dispose();
                return(intFalg);
            }
            catch (Exception ee)
            {
                return(intFalg);
            }
        }
Beispiel #18
0
        public SqlDataReader dtb_SellGoodsFind(string DataObject)
        {
            string strSecar = null;

            try
            {
                strSecar = "select * from tb_SellGoods where SellID='" + DataObject + "'";

                getSqlConnection getConnection = new getSqlConnection();
                conn = getConnection.GetCon();
                cmd  = new SqlCommand(strSecar, conn);

                qlddr = cmd.ExecuteReader();
                return(qlddr);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(qlddr);
            }
        }
Beispiel #19
0
        public int tb_CompanyMenthodAdd(tb_Company Company)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "insert into tb_Company values( ";
                str_Add += "'" + Company.intCompanyID + "','" + Company.strCompanyName + "',";
                str_Add += "'" + Company.strCompanyPhone + "','" + Company.strCompanyFax + "','" + Company.strCompanyAddress + "',";
                str_Add += "'" + Company.intEmpFalg + "','" + Company.strCompanyDirector + "')";
                getSqlConnection getConnection = new getSqlConnection();
                conn    = getConnection.GetCon();
                cmd     = new SqlCommand(str_Add, conn);
                intFalg = cmd.ExecuteNonQuery();
                conn.Dispose();
                return(intFalg);
            }
            catch (Exception ee)
            {
                return(intFalg);
            }
        }
Beispiel #20
0
        public SqlDataReader tb_JhGoodsInfoFind(string strObject)
        {
            int    intCount = 0;
            string strSecar = null;

            try
            {
                strSecar = "select * from tb_thgoodsinfo  where thGoodsid= '" + strObject + "'";


                getSqlConnection getConnection = new getSqlConnection();
                conn  = getConnection.GetCon();
                cmd   = new SqlCommand(strSecar, conn);
                qlddr = cmd.ExecuteReader();
                return(qlddr);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(qlddr);
            }
        }
        public SqlDataReader tb_ThGoodsFind1(string goodname)
        {
            string strSecar = null;

            try
            {
                strSecar = "select * from tb_KcGoods  where KcGoodsName ='" + goodname + "'";


                getSqlConnection getConnection = new getSqlConnection();
                conn = getConnection.GetCon();
                cmd  = new SqlCommand(strSecar, conn);

                qlddr = cmd.ExecuteReader();
                return(qlddr);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(qlddr);
            }
        }
Beispiel #22
0
        public int tb_JhGoodsInfoMenthodDelete(tb_JhGoodsInfo tbGood)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "update tb_JhGoodsInfo set ";

                str_Add += "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();
                return(intFalg);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
Beispiel #23
0
        public int tb_EmpInfoFind(string strObject, string pwwd, int intFalg)
        {
            int    intCount = 0;
            string strSecar = null;

            try
            {
                switch (intFalg)
                {
                case 1:
                    strSecar = "select * from tb_EmpInfo where EmpLoginName= '" + strObject + "' and EmpFalg=0";
                    break;

                case 2:
                    strSecar = "select * from tb_EmpInfo where EmpLoginName= '" + strObject + "' and EmpFalg=0 and EmpLoginPwd='" + pwwd + "'";
                    break;
                }

                getSqlConnection getConnection = new getSqlConnection();
                conn = getConnection.GetCon();
                cmd  = new SqlCommand(strSecar, conn);

                qlddr = cmd.ExecuteReader();
                qlddr.Read();
                if (qlddr.HasRows)
                {
                    intCount = 1;
                }


                return(intCount);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message.ToString());
                return(intCount = 2);
            }
        }
        //修改数量
        public int tb_KcGoodsUpdate1(string name, int kcnum)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "update tb_KcGoods set  ";
                str_Add += "KcNum=" + kcnum + "";
                str_Add += "where KcGoodsName ='" + name + "'";

                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);
            }
        }
Beispiel #25
0
        public SqlDataReader tb_CompanyFind(string strObject)
        {
            string strSecar = null;

            try
            {
                strSecar = "select * from tb_Company  where CompanyID =  '" + strObject + "' and Falg= 0";


                getSqlConnection getConnection = new getSqlConnection();
                conn = getConnection.GetCon();
                cmd  = new SqlCommand(strSecar, conn);
                int ii = 0;
                qlddr = cmd.ExecuteReader();
                return(qlddr);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());

                return(qlddr);
            }
        }
Beispiel #26
0
        }// end if

        #endregion
        #region  除
        public int tb_ThGoodsDelete(string striThid)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "delete from tb_thgoodsinfo  where ThGoodsID='" + striThid + "'";



                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_SellGoodsAdd(tb_SellGoods tbChGood)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "insert into tb_SellGoods values( ";
                str_Add += "'" + tbChGood.strSellID + "','" + tbChGood.strKcID + "','" + tbChGood.strGoodsID + "',";
                str_Add += "'" + tbChGood.strEmpId + "','" + tbChGood.strGoodsName + "','" + tbChGood.strSellGoodsNum + "',";
                str_Add += "'" + tbChGood.daSellGoodsTime + "','" + tbChGood.deSellPrice + "',";
                str_Add += "'" + tbChGood.deSellNeedPay + "','" + tbChGood.deSellHasPay + "','" + tbChGood.strSellRemark + "'," + tbChGood.intSellFalg + ")";
                getSqlConnection getConnection = new getSqlConnection();
                conn    = getConnection.GetCon();
                cmd     = new SqlCommand(str_Add, conn);
                intFalg = cmd.ExecuteNonQuery();
                conn.Dispose();

                tb_KcGoodsMenthod kc1 = new tb_KcGoodsMenthod();

                /*qlddr = kc1.tb_ThGoodsFind1(tbChGood.strGoodsName);
                 *
                 * int ykc = Convert.ToInt32(qlddr["KcNum"]);
                 * MessageBox.Show("sdd"+ykc);
                 * Console.WriteLine();
                 *
                 * int xkc = ykc - tbChGood.strSellGoodsNum;
                 * tb_KcGoodsMenthod kc2 = new tb_KcGoodsMenthod();
                 * kc2.tb_KcGoodsUpdate1(tbChGood.strGoodsName, xkc);*/

                return(intFalg);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
Beispiel #28
0
        public int tb_SellGoodsDelete(tb_SellGoods tbChGood)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "update tb_SellGoods set ";

                str_Add += "SellFalg=" + tbChGood.intSellFalg + "";
                str_Add += " where  SellID= '" + tbChGood.strSellID + "'";

                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);
            }
        }
Beispiel #29
0
        public int tb_ThGoodsAdd(tb_ThGoodsInfo tbChGood)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "insert into tb_ThGoodsInfo values( ";
                str_Add += "'" + tbChGood.strThGoodsID + "','" + tbChGood.strKcID + "','" + tbChGood.strGoodsID + "',";
                str_Add += "'" + tbChGood.strSellID + "','" + tbChGood.intEmpId + "','" + tbChGood.strThGoodsName + "',";
                str_Add += "" + tbChGood.intThGoodsNum + ",'" + tbChGood.daThGoodsTime + "'," + tbChGood.deThGoodsPrice + ",";
                str_Add += "" + tbChGood.deThHasPay + "," + tbChGood.deThNeedPay + ",'" + tbChGood.deThGoodsResult + "')";
                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);
            }
        }
Beispiel #30
0
        public void tb_EmpInfoFind(string strObject, int intFalg, Object DataObject)
        {
            int    intCount = 0;
            string strSecar = null;

            try
            {
                switch (intFalg) //判断条件
                {
                case 1:          //"员工姓名":
                    strSecar = "select * from tb_EmpInfo where EmpName like  '%" + strObject + "%' and EmpFalg=0";
                    break;

                case 2:    //员工性别

                    strSecar = "select  * from  tb_EmpInfo  where  EmpSex  = '" + strObject + "' and EmpFalg=0";
                    break;

                case 3:    //所属部门"
                    strSecar = "select * from tb_EmpInfo where EmpDept like '%" + strObject + "%' and EmpFalg=0";
                    break;

                case 4:    //"员工职位":
                    strSecar = "select * from tb_EmpInfo where EmpPost like '%" + strObject + "%' and EmpFalg=0";
                    break;

                case 5:
                    strSecar = "select * from tb_EmpInfo where EmpFalg=0";
                    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[0].ToString();
                        dv[1, i].Value = qlddr[1].ToString();
                        dv[2, i].Value = qlddr[4].ToString();
                        dv[3, i].Value = qlddr[6].ToString();
                        dv[4, i].Value = qlddr[7].ToString();
                        dv[5, i].Value = qlddr[9].ToString();
                        i++;
                    }
                    qlddr.Close();
                }
                else
                {
                    for (int i = 0; i < dv.RowCount; i++)
                    {
                        dv[0, i].Value = "";
                        dv[1, i].Value = "";
                        dv[2, i].Value = "";
                        dv[3, i].Value = "";
                        dv[4, i].Value = "";
                        dv[5, i].Value = "";
                    }
                }
            }
            catch (Exception ee)
            {
            }
        }