예제 #1
0
        private void updatePesticideJob()
        {
            PesticideJob pj = new PesticideJob();

            pj.Id          = pjj11.Id;
            pj.Description = textBox1.Text;
            string idStr = cbPesticide.Text.Split('.')[0];

            pj.Pesticide_id = int.Parse(idStr);
            pj.Quantity_kg  = int.Parse(textBox3.Text);
            string idStr1 = cbSoj.Text.Split('.')[0];

            pj.SowingJob_id = int.Parse(idStr1);
            string idStr2 = cbFarm.Text.Split('.')[0];

            pj.Farm_id = int.Parse(idStr2);
            string idStr3 = cbVehicle.Text.Split('.')[0];

            pj.Vehicle_id = int.Parse(idStr3);
            string idStr4 = cbCrop.Text.Split('.')[0];

            pj.Crop_id = int.Parse(idStr4);
            string idStr5 = cbEmployee.Text.Split('.')[0];

            pj.Employee_id = int.Parse(idStr5);
            pj.Date_start  = Convert.ToDateTime(dtpStart.Text);
            pj.Date_end    = Convert.ToDateTime(dtpEnd.Text);

            UpdateSQL hdl = new UpdateSQL();

            hdl.updatePesticideJob(pj);
            MessageBox.Show("Success!!");
            this.Close();
        }
예제 #2
0
        public void update()
        {
            SowingJob s1 = new SowingJob();

            s1.Id          = sowj.Id;
            s1.Description = tbDescription.Text;
            string idStr = cbCrop.Text.Split('.')[0];

            s1.Crop_id       = int.Parse(idStr);
            s1.Quantity_prop = int.Parse(nUDQty.Text);
            string idStr1 = cbFarm.Text.Split('.')[0];

            s1.Farm_id   = int.Parse(idStr1);
            s1.Used_area = textBox1.Text;
            string idStr2 = cbVehicle.Text.Split('.')[0];

            s1.Vehicle_id = int.Parse(idStr2);
            string idStr3 = cbEmployee.Text.Split('.')[0];

            s1.Employee_id = int.Parse(idStr3);
            s1.Date_start  = this.dtpDate.Value;
            s1.Date_end    = this.dtpDateEnd.Value;


            UpdateSQL add       = new UpdateSQL();
            int       addrecord = add.UpdateSowingJob(s1);

            MessageBox.Show("Success!!");
            this.Close();
        }
예제 #3
0
        private void updateFertiliser()
        {
            FertilisingJob fj = new FertilisingJob();

            fj.Id          = fb11.Id;
            fj.Description = textBox1.Text;
            string idStr = cbFertiliser.Text.Split('.')[0];

            fj.Fertiliser_id = int.Parse(idStr);
            fj.Quantity_kg   = int.Parse(textBox3.Text);
            string idStr1 = cbSoj.Text.Split('.')[0];

            fj.SowingJob_id = int.Parse(idStr1);
            string idStr2 = cbFarm.Text.Split('.')[0];

            fj.Farm_id = int.Parse(idStr2);
            string idStr3 = cbVehicle.Text.Split('.')[0];

            fj.Vehicle_id = int.Parse(idStr3);
            string idStr4 = cbCrop.Text.Split('.')[0];

            fj.Crop_id = int.Parse(idStr4);
            string idStr5 = cbEmployee.Text.Split('.')[0];

            fj.Employee_id = int.Parse(idStr5);
            fj.Date_start  = this.dtpStart.Value;
            fj.Date_end    = this.dtpEnd.Value;

            UpdateSQL edit       = new UpdateSQL();
            int       editrecord = edit.updateFertilisingJob(fj);

            MessageBox.Show("Success!!");
            this.Close();
        }
예제 #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtProductName.Text))
     {
         MessageBox.Show("请输入商品名称");
     }
     if (string.IsNullOrEmpty(txtInPrice.Text))
     {
         MessageBox.Show("请输入进货价格");
     }
     if (string.IsNullOrEmpty(txtProductCode.Text))
     {
         MessageBox.Show("请输入商品编号");
     }
     //插入
     if (_opearType == "添加")
     {
         var sql = InsertSQL.InsertProduct(txtProductName.Text, txtInPrice.Text, txtOutPrice.Text,
                                           txtProductCode.Text, txtProductNum.Text, txtRemark.Text, _clientId, _pictureId);
         MessageBox.Show(InsertData.InsertIntoData(sql) ? "添加商品成功" : "添加商品失败");
     }
     //更新
     if (_opearType == "修改")
     {
         var updatesql = UpdateSQL.UpdateProduct(txtProductName.Text, txtInPrice.Text, txtOutPrice.Text,
                                                 txtProductCode.Text, txtProductNum.Text, txtRemark.Text, _clientId, _pictureId, _productId);
         MessageBox.Show(UpdateData.UpdateInfo(updatesql) ? "更新商品成功" : "更新商品失败");
     }
     Close();
 }
예제 #5
0
        private void updateStoringJob()
        {
            StoringJob sj = new StoringJob();

            sj.Id          = sj1.Id;
            sj.Description = textBox1.Text;
            string idStr = cbHarvest.Text.Split('.')[0];

            sj.Harvest_id = int.Parse(idStr);
            string idStr1 = cbCrop.Text.Split('.')[0];

            sj.Crop_id = int.Parse(idStr1);
            string idStr2 = cbBox.Text.Split('.')[0];

            sj.Box_id   = int.Parse(idStr2);
            sj.Quantity = int.Parse(textBox5.Text);
            string idStr3 = cbVehicle.Text.Split('.')[0];

            sj.Vehicle_id = int.Parse(idStr3);
            string idStr4 = cbEmployee.Text.Split('.')[0];

            sj.Employee_id = int.Parse(idStr4);
            sj.Date_start  = Convert.ToDateTime(dtpStart.Text);
            sj.Date_end    = Convert.ToDateTime(dtpEnd.Text);

            UpdateSQL update = new UpdateSQL();

            update.updateStoringJob(sj);
            MessageBox.Show(" Your record is added");
            this.Close();
        }
예제 #6
0
        private void updateHarvestingJob()
        {
            HarvestingJob hj = new HarvestingJob();

            hj.Id           = hj11.Id;
            hj.Description  = textBox1.Text;
            hj.SowingJob_id = Convert.ToInt32(cbSoj.Text);
            string idStr = cbFarm.Text.Split('.')[0];

            hj.Farm_id = int.Parse(idStr);
            string idStr1 = cbCrop.Text.Split('.')[0];

            hj.Crop_id = int.Parse(idStr1);
            string idStr2 = cbVehicle.Text.Split('.')[0];

            hj.Vehicle_id         = int.Parse(idStr2);
            hj.Est_quantity       = int.Parse(numericUpDown1.Text);
            hj.Harvested_quantity = int.Parse(numericUpDown2.Text);
            string idStr3 = cbEmployee.Text.Split('.')[0];

            hj.Employee_id = int.Parse(idStr3);
            hj.Date_start  = Convert.ToDateTime(dtpStart1.Value);
            hj.Date_end    = Convert.ToDateTime(dtpEnd.Value);

            UpdateSQL hdl = new UpdateSQL();

            hdl.updateHarvestingJob(hj);
            MessageBox.Show("Success!!");
            this.Close();
        }
예제 #7
0
        private void SQLHelp_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();

            ssc       = new SQLStringCheck();
            dbf       = new DataBaseField();
            insql     = new InsertSQL();
            updatesql = new UpdateSQL();
            ocon      = new ObjectConstructor();

            IntiData();
        }
예제 #8
0
        public void UpdatePesticide()
        {
            Pesticide p1 = new Pesticide();

            p1.Id          = p11.Id;
            p1.Name        = textBox1.Text;
            p1.Quantity_kg = Int32.Parse(textBox2.Text);
            p1.Remark      = textBox3.Text;

            UpdateSQL ord          = new UpdateSQL();
            int       changerecord = ord.updatePesticide(p1);

            MessageBox.Show("Successful!");
        }
예제 #9
0
        private void CheckProfile(string first_name, string last_name, DateTime dob, string mobile, string email)
        {
            Employee employee = new Employee();

            employee.First_name = textBox1.Text;
            employee.Last_name  = textBox2.Text;
            employee.Dob        = Convert.ToDateTime(dateTimePicker1.Text);
            employee.Remark     = textBox3.Text;
            employee.Email      = textBox4.Text;
            UpdateSQL update     = new UpdateSQL();
            int       editrecord = update.editEmployee(employee);

            MessageBox.Show(" Your seccusful");
            this.Close();
        }
예제 #10
0
        private void updateFertiliser()
        {
            Fertiliser f1 = new Fertiliser();

            f1.Id          = f11.Id;
            f1.Name        = textBox1.Text;
            f1.Quantity_kg = Convert.ToInt32(textBox2.Text);
            f1.Remark      = textBox3.Text;

            UpdateSQL add        = new UpdateSQL();
            int       editrecord = add.updateFertiliser(f1);

            MessageBox.Show("Seccuess!!");
            this.Close();
        }
예제 #11
0
        public void updateFarm()
        {
            Farm f1 = new Farm();

            f1.Id           = farmfarm.Id;
            f1.Description  = descriptionText.Text;
            f1.Area         = Convert.ToInt32(areaText.Text);
            f1.Utilize_area = Convert.ToInt32(utiliseAreaText.Text);

            UpdateSQL add        = new UpdateSQL();
            int       editrecord = add.updateFarm(f1);

            MessageBox.Show("Successful");
            this.Close();
        }
예제 #12
0
        public void updateVehicle()
        {
            Vehicle vech = new Vehicle();

            vech.Id                = v11.Id;
            vech.Name              = nameText.Text;
            vech.Serial_number     = serialNumText.Text;
            vech.Buy_date          = this.buyDateTimePicker.Value;
            vech.Last_service_date = this.serviceDateTimePicker.Value;
            vech.Remark            = remarkText.Text;

            UpdateSQL vechHnd   = new UpdateSQL();
            int       addrecord = vechHnd.updateVehicle(vech);

            MessageBox.Show(addrecord + "Your record is added");
        }
예제 #13
0
 public static bool UpdateRecordOver(int blogId)
 {
     try
     {
         IUpdateDataSourceFace query = new UpdateSQL(TableName.ResourceRecord);
         query.DataBaseAlias = Const.LogConnection;
         query.AddWhere("BlogId", blogId);
         query.AddFieldValue("Continued", false);
         return(query.ExecuteNonQuery() > 0);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(false);
     }
 }
예제 #14
0
        public void updateCrop()
        {
            Crop crop = new Crop();

            crop.Id            = cr.Id;
            crop.Name          = textBox1.Text;
            crop.Type          = textBox2.Text;
            crop.Quantity_plot = Convert.ToInt32(textBox3.Text);
            crop.Remark        = textBox4.Text;

            UpdateSQL add        = new UpdateSQL();
            int       editrecord = add.updateCrop(crop);

            MessageBox.Show(" Your seccusful");
            this.Close();
        }
예제 #15
0
        public void updateCustomer()
        {
            //CheckCustomer(textBox1.Text, textBox2.Text, textBox3.Text, textBox2.Text);
            Customer custU = new Customer();

            custU.Id     = cust.Id;
            custU.Name   = textBox1.Text;
            custU.Email  = textBox2.Text;
            custU.Phone  = textBox3.Text;
            custU.Remark = textBox4.Text;

            UpdateSQL custHnd      = new UpdateSQL();
            int       updateRecord = custHnd.updateCustomer(custU);

            MessageBox.Show(updateRecord + " Your record is updated");
            this.Close();
        }
예제 #16
0
        private void update()
        {
            Product prod = new Product();

            prod.Id           = prodd.Id;
            prod.Name         = nameText.Text;
            prod.Type         = typeText.Text;
            prod.Quantity_box = Convert.ToInt32(quantityNumericUpDown.Value);
            prod.Weight       = decimal.Parse(weightText.Text);
            prod.Box_id       = Int32.Parse(boxIdText.Text);

            UpdateSQL prodHnd      = new UpdateSQL();
            int       updaterecord = prodHnd.updateProduct(prod);

            MessageBox.Show(updaterecord + " Your record is added");
            this.Close();
        }
예제 #17
0
 public static bool UpdateFetchCount(int fetchCount, int requestCount, int id)
 {
     try
     {
         IUpdateDataSourceFace query = new UpdateSQL(TableName.FetchRecord);
         query.DataBaseAlias = Const.LogConnection;
         query.AddWhere("Id", id);
         query.AddFieldValue("FetchCount", fetchCount);
         query.AddFieldValue("RequestCount", requestCount);
         return(query.ExecuteNonQuery() > 0);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(false);
     }
 }
예제 #18
0
        private void updateBox()
        {
            Box box = new Box();

            box.Id         = bb1.Id;
            box.Name       = textBox1.Text;
            box.Width      = Convert.ToDouble(textBox2.Text);
            box.Height     = Convert.ToDouble(textBox3.Text);
            box.Length     = Convert.ToDouble(textBox4.Text);
            box.Max_weight = Convert.ToDouble(textBox5.Text);
            box.Quantity   = Convert.ToInt32(textBox6.Text);
            box.Status     = textBox7.Text;

            UpdateSQL addHnd    = new UpdateSQL();
            int       addrecord = addHnd.updateBox(box);

            MessageBox.Show("Success!!");
            this.Close();
        }
예제 #19
0
        public void updateStock()
        {
            Storeroom store = new Storeroom();

            store.Id          = sr1.Id;
            store.Description = descriptionText.Text;
            store.StoringQty  = Convert.ToInt32(storeNumericUpDown.Value);
            store.Temperature = Int32.Parse(tempText.Text);
            bool avail        = false;
            int  availability = availabilityBox.SelectedIndex;

            if (availability == 1)
            {
                avail = true;
            }
            store.Availability = avail;
            UpdateSQL storeHnd = new UpdateSQL();

            storeHnd.updateStore(store);
            MessageBox.Show(" Your record is added");
        }
예제 #20
0
        private void updateBoxStorage()
        {
            BoxStorage bs1 = new BoxStorage();

            bs1.Id            = bs11.Id;
            bs1.StoringJob_id = int.Parse(textBox1.Text);
            bs1.Product_id    = int.Parse(textBox2.Text);
            bs1.Box_id        = int.Parse(textBox3.Text);
            bs1.NettWeight    = double.Parse(textBox4.Text);
            bs1.Storeroom_id  = int.Parse(textBox5.Text);
            bs1.Add_date      = Convert.ToDateTime(dateTimePicker1.Text);
            bs1.Best_before   = Convert.ToDateTime(dateTimePicker2.Text);
            bs1.Out_date      = Convert.ToDateTime(dateTimePicker3.Text);
            bs1.Order_id      = int.Parse(textBox6.Text);

            UpdateSQL add        = new UpdateSQL();
            int       editrecord = add.updateBoxStorage(bs1);

            MessageBox.Show(" Your seccusful");
            this.Close();
        }
예제 #21
0
        public void UpdateEmployee()
        {
            Employee empi = new Employee();

            empi.Id         = emp1.Id;
            empi.First_name = firstNameText.Text;
            empi.Last_name  = lastNameText.Text;
            empi.Username   = usernameText.Text;
            empi.Password   = passwordText.Text;
            empi.Dob        = DateTime.Parse(dobText.Text);
            empi.Mobile     = mobileText.Text;
            empi.Email      = emailText.Text;
            empi.Admin      = Boolean.Parse(adminText.Text);
            empi.Status     = statusText.Text;
            empi.Remark     = remarkText.Text;

            UpdateSQL empHnd       = new UpdateSQL();
            int       Updaterecord = empHnd.UpdateEmployee(empi);

            MessageBox.Show(Updaterecord + " Your record is added");
            this.Close();
        }
예제 #22
0
 private void button1_Click(object sender, System.EventArgs e)
 {
     if (string.IsNullOrEmpty(txtClientName.Text))
     {
         MessageBox.Show("请输入客户姓名");
     }
     if (string.IsNullOrEmpty(txtClientPhone.Text))
     {
         MessageBox.Show("请输入客户手机");
     }
     //插入
     if (_opearType == "添加")
     {
         var sql = InsertSQL.InsertClient(txtClientName.Text, txtClientPhone.Text);
         MessageBox.Show(InsertData.InsertIntoData(sql) ? "添加客户成功" : "添加客户失败");
     }
     //更新
     if (_opearType == "修改")
     {
         var updatesql = UpdateSQL.UpdateClient(txtClientName.Text, txtClientPhone.Text, _clientId);
         MessageBox.Show(UpdateData.UpdateInfo(updatesql) ? "更新客户成功" : "更新客户失败");
     }
     Close();
 }
예제 #23
0
        public void UpdateOrder()
        {
            Order ordi = new Order();

            ordi.Id               = ord.Id;
            ordi.Description      = textBox1.Text;
            ordi.Product_id       = Int32.Parse(comboBox1.Text);
            ordi.Quantity_box     = Int32.Parse(textBox2.Text);
            ordi.Weight           = Double.Parse(textBox3.Text);
            ordi.PalletAllocation = int.Parse(textBox4.Text);
            ordi.Customer_id      = int.Parse(comboBox2.Text);
            ordi.Order_date       = this.dateTimePicker2.Value;
            ordi.Collection_date  = this.dateTimePicker2.Value;
            ordi.Price            = double.Parse(textBox5.Text);
            ordi.Status           = textBox6.Text;
            ordi.Remark           = textBox7.Text;


            UpdateSQL ordHnd       = new UpdateSQL();
            int       changerecord = ordHnd.UpdateOrder(ordi);

            MessageBox.Show(changerecord + " Your record is added");
            this.Close();
        }