예제 #1
0
        public bool InsertInfo(SaleEntity obj)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("insert into  tb_sale(saleId,commodityName,saleDate,saleNumber,payMethod,workerName" +
                                           ",Gonghao) values(" + "'" + obj.SalesrecordsId + "'" + "," + "'" + obj.Productname + "'" + ","
                                           + "'" + obj.Saledate + "'" + "," + "'" + obj.Salenumber + "'" + "," + "'" + obj.Paymethod + "'" + "," + "'" + obj.Workername +
                                           "'" + "," + "'" + obj.Jobnumber + "')");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
        public bool InsertInfo(PurchaseEntity obj)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("insert into  tb_purchase(purchaseId,commodityName,purchaseNumber,costPrice,total,purchaseDate" +
                                           ",handler,purchaseStatus) values(" + "'" + obj.PurchaseId + "'" + "," + "'" + obj.Productname + "'" + ","
                                           + "'" + obj.Purchasenumber + "'" + "," + "'" + obj.Costprice + "'" + "," + "'" + obj.Total + "'" + "," + "'" + obj.Purchasedate +
                                           "'" + "," + "'" + obj.Experience + "'" + "," + "'" + obj.Purchasestate + "')");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
        public bool UpdateInfo(PurchaseEntity obj, string jobnumber)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("update tb_purchase set purchaseId='" + obj.PurchaseId + "'," +
                                           "commodityName='" + obj.Productname + "',purchaseNumber='" + obj.Purchasenumber + "',costPrice='" + obj.Costprice + "',total=" +
                                           "'" + obj.Total + "',purchaseDate='" + obj.Purchasedate + "'" +
                                           ",handler='" + obj.Experience + "',purchaseStatus='" + obj.Purchasestate + "' where purchaseId='" + jobnumber + "'");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
예제 #4
0
        public bool InsertInfo(SupplierEntity obj)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("insert into  tb_supplier(supplierId,businessName,contacts,phone,address,settlementMethod)" +
                                           " values(" + "'" + obj.SupplierId + "'" + "," + "'" + obj.Merchantname + "'" + ","
                                           + "'" + obj.Contacts + "'" + "," + "'" + obj.Phone + "'" + "," + "'" + obj.Address + "'" + "," + "'" + obj.Settlement + "')");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
예제 #5
0
        public bool UpdateInfo(SaleEntity obj, string jobnumber)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("update tb_sale set saleId='" + obj.SalesrecordsId + "'," +
                                           "commodityName='" + obj.Productname + "',saleDate='" + obj.Saledate + "',saleNumber='" + obj.Salenumber + "',payMethod=" +
                                           "'" + obj.Paymethod + "',workerName='" + obj.Workername + "'" +
                                           ",Gonghao='" + obj.Jobnumber + "' where saleId='" + jobnumber + "'");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
예제 #6
0
        public bool InsertInfo(ProductInfoEntity obj)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("insert into  tb_commodityInfo(commodityId,commodityName,businessName,costPrice,unitPrice,commodityNumber" +
                                           ",remarks) values(" + "'" + obj.ProductId + "'" + "," + "'" + obj.Productname + "'" + ","
                                           + "'" + obj.Merchantname + "'" + "," + "'" + obj.Costprice + "'" + "," + "'" + obj.Unitprice + "'" + "," + "'" + obj.Merchantinventory +
                                           "'" + "," + "'" + obj.Remarks + "')");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
예제 #7
0
        public bool UpdateInfo(SupplierEntity obj, string jobnumber)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("update tb_supplier set businessName='" + obj.Merchantname + "'," +
                                           "contacts='" + obj.Contacts + "',phone='" + obj.Phone + "',address='" + obj.Address + "',settlementMethod=" +
                                           "'" + obj.Settlement + "' where supplierId='" + jobnumber + "'");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
예제 #8
0
        public bool UpdateInfo(ProductInfoEntity obj, string jobnumber)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("update tb_commodityInfo set commodityId='" + obj.ProductId + "'," +
                                           "commodityName='" + obj.Productname + "',businessName='" + obj.Merchantname + "',costPrice='" + obj.Costprice + "',unitPrice=" +
                                           "'" + obj.Unitprice + "',commodityNumber='" + obj.Merchantinventory + "'" +
                                           ",remarks='" + obj.Remarks + "' where purchaseId='" + jobnumber + "'");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
        public bool InsertInfo(WorkerEntity obj)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("insert into  tb_zhigong(Gonghao,Password,Name,Shenfenzhenghao,Sex,Address" +
                                           ",Gongzuodanwei,Phone,Birth,Ruyongriqi) values(" + "'" + obj.Jobnumber + "'" + "," + "'" + obj.Password + "'" + ","
                                           + "'" + obj.Name + "'" + "," + "'" + obj.Idnumber + "'" + "," + "'" + obj.Sex + "'" + "," + "'" + obj.Address +
                                           "'" + "," + "'" + obj.Workunit + "'" + "," + "'" + obj.Phone + "'" + "," + "'" + obj.Birth + "'" + "," + "'" + obj.Hiredate + "'" + ")");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
예제 #10
0
        public bool UpdateInfo(WorkerEntity obj, string jobnumber)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("update tb_zhigong set Password='******'," +
                                           "Name='" + obj.Name + "',Shenfenzhenghao='" + obj.Idnumber + "',Sex='" + obj.Sex + "',Address=" +
                                           "'" + obj.Address + "',Phone='" + obj.Phone + "'" +
                                           ",Birth='" + obj.Birth + "',Ruyongriqi='" + obj.Hiredate + "'where Gonghao='" + jobnumber + "'");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
        public bool DeleteInfo(string jobnumber)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("delete from tb_purchase where purchaseId='" + jobnumber + "'");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
        public bool SelectUniqueInfo(WorkerEntity obj)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("select Gonghao from tb_zhigong where Gonghao='" + obj.Jobnumber + "'");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }
        //注册
        public bool InsertInfo(WorkerEntity obj)
        {
            con = Connectionsql.Connection();
            bool term = SelectMysql.result("insert into  tb_zhigong(Gonghao,Password,Gongzuodanwei) values(" + "'" + obj.Jobnumber + "'" + "," + "'" + obj.Password + "'" + ","
                                           + "'" + obj.Workunit + "')");

            try
            {
                if (term == true)
                {
                    return(term);
                }
            }
            catch (MySqlException e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
            }
            finally
            {
                con.Close();
            }

            return(term);
        }