コード例 #1
0
        private void FormBoxStorage_Load(object sender, EventArgs e)
        {
            InsertSQL bs = new InsertSQL();

            //productLists = order1.GetPorductList();

            if (state == "Edit")
            {
                InsertSQL boxStorage = new InsertSQL();
                //productLists = order1.GetPorductList();

                if (state == "Edit")
                {
                    bs11.Add_date         = Convert.ToDateTime(dateTimePicker1.Text);
                    textBox1.Text         = bs11.StoringJob_id.ToString();
                    textBox2.Text         = bs11.Product_id.ToString();
                    textBox3.Text         = bs11.Box_id.ToString();
                    textBox4.Text         = bs11.NettWeight.ToString();
                    textBox5.Text         = bs11.Storeroom_id.ToString();
                    dateTimePicker1.Value = bs11.Add_date;
                    dateTimePicker2.Value = bs11.Best_before;
                    dateTimePicker3.Value = bs11.Out_date;
                    textBox6.Text         = bs11.Order_id.ToString();
                }
            }
        }
コード例 #2
0
        private void addHarvestingJob()
        {
            HarvestingJob hj = new HarvestingJob();

            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);

            InsertSQL hdl = new InsertSQL();

            hdl.addNewHarvestingJob(hj);
            MessageBox.Show("Success!!");
            this.Close();
        }
コード例 #3
0
        public void add()
        {
            //checkAsignJobandAdd();
            SowingJob s1 = new SowingJob();

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

            s1.Crop_id       = int.Parse(idStr);
            s1.Quantity_prop = Int32.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;
            //s1.Employee_id = Int32.Parse(cbEmployee.Text);

            InsertSQL add       = new InsertSQL();
            int       addrecord = add.addNewSowingJob(s1);

            MessageBox.Show("Success!!");

            this.Close();
        }
コード例 #4
0
        private void addPesticideJob()
        {
            PesticideJob pj = new PesticideJob();

            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);

            InsertSQL add       = new InsertSQL();
            int       addrecord = add.addNewPesticideJob(pj);

            MessageBox.Show("Success!!");
            this.Close();
        }
コード例 #5
0
        private void addFertiliser()
        {
            FertilisingJob fj = new FertilisingJob();

            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;

            InsertSQL add       = new InsertSQL();
            int       addrecord = add.addNewFertilisingJob(fj);

            MessageBox.Show("Success!!");
            this.Close();
        }
コード例 #6
0
ファイル: ProductInfo.cs プロジェクト: friendlww/zhoulb
 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();
 }
コード例 #7
0
        private void addStoringJob()
        {
            StoringJob sj = new StoringJob();

            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);

            InsertSQL addHnd    = new InsertSQL();
            int       addrecord = addHnd.addNewStoringJob(sj);

            MessageBox.Show(addrecord + " Your record is added");
            this.Close();
        }
コード例 #8
0
        private void FormStoringJob_Load(object sender, EventArgs e)
        {
            InsertSQL StoringJob = new InsertSQL();

            if (state == "Edit")
            {
                textBox1.Text   = sj1.Description;
                cbHarvest.Text  = sj1.Harvest_id.ToString();
                cbCrop.Text     = sj1.Crop_id.ToString();
                cbBox.Text      = sj1.Box_id.ToString();
                textBox5.Text   = sj1.Quantity.ToString();
                cbVehicle.Text  = sj1.Vehicle_id.ToString();
                cbEmployee.Text = sj1.Employee_id.ToString();
                dtpStart.Value  = sj1.Date_start;
                dtpEnd.Value    = sj1.Date_end;

                TestSQL ts = new TestSQL();
                cropLists    = ts.GetCropList();
                employeeList = ts.GetEmployeeList();
                vehicleList  = ts.GetVehicleList();
                boxList      = ts.GetBoxList();
                harvestLists = ts.GetHarvestingJobList();

                SowingJob sj11 = new SowingJob();

                foreach (HarvestingJob harvest in harvestLists)
                {
                    string showText = harvest.Id + ". " + harvest.Description;
                    cbCrop.Items.Add(showText);
                }

                foreach (Box box in boxList)
                {
                    string showText = box.Id + ". " + box.Name;
                    cbCrop.Items.Add(showText);
                }

                foreach (Crop crop1 in cropLists)
                {
                    string showText = crop1.Id + ". " + crop1.Name;
                    cbCrop.Items.Add(showText);
                }

                foreach (Vehicle vehicle in vehicleList)
                {
                    string showText = vehicle.Id + ". " + vehicle.Name;
                    cbVehicle.Items.Add(showText);
                }

                foreach (Employee employee in employeeList)
                {
                    if (employee.Admin == false)
                    {
                        string showText = employee.Id + ". " + employee.Username;
                        cbEmployee.Items.Add(showText);
                    }
                }
            }
        }
コード例 #9
0
        private void FormPesticide_Load(object sender, EventArgs e)
        {
            InsertSQL pesticide = new InsertSQL();

            if (state == "Edit")
            {
                textBox1.Text = p11.Name;
                textBox2.Text = p11.Quantity_kg.ToString();
                textBox3.Text = p11.Remark;
            }
        }
コード例 #10
0
        private void FormFertiliser_Load(object sender, EventArgs e)
        {
            InsertSQL crop = new InsertSQL();

            if (state == "Edit")
            {
                textBox1.Text = f11.Name;
                textBox2.Text = f11.Quantity_kg.ToString();
                textBox3.Text = f11.Remark;
            }
        }
コード例 #11
0
ファイル: FormFarm.cs プロジェクト: helloVorld/JustRipeFarm
        //private bool checkInput()
        //{
        //int checkint;
        //if (!int.TryParse(areaText.Text, out checkint))
        //{
        //    return false;
        //}
        //if (!int.TryParse(utiliseAreaText.Text, out checkint))
        //{
        //    return false;
        //}
        //return true;
        //}

        private void FormFarm_Load(object sender, EventArgs e)
        {
            InsertSQL farm = new InsertSQL();

            if (state == "Edit")
            {
                descriptionText.Text = farmfarm.Description;
                areaText.Text        = farmfarm.Area.ToString();
                utiliseAreaText.Text = farmfarm.Utilize_area.ToString();
            }
        }
コード例 #12
0
        private void FormStoreroom_Load(object sender, EventArgs e)
        {
            InsertSQL storeroom = new InsertSQL();

            if (state == "Edit")
            {
                descriptionText.Text    = sr1.Description;
                storeNumericUpDown.Text = sr1.StoringQty.ToString();
                tempText.Text           = sr1.Temperature.ToString();
            }
        }
コード例 #13
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();
        }
コード例 #14
0
        private void FormCropcs_Load(object sender, EventArgs e)
        {
            InsertSQL crop = new InsertSQL();

            if (state == "Edit")
            {
                textBox1.Text = cr.Name;
                textBox2.Text = cr.Type;
                textBox3.Text = cr.Quantity_plot.ToString();
                textBox4.Text = cr.Remark.ToString();
            }
        }
コード例 #15
0
        private void FormCustomer_Load(object sender, EventArgs e)
        {
            InsertSQL customer1 = new InsertSQL();

            if (state == "Edit")
            {
                textBox1.Text = cust.Name;
                textBox2.Text = cust.Email;
                textBox3.Text = cust.Phone;
                textBox4.Text = cust.Remark;
            }
        }
コード例 #16
0
        private void FormProduct_Load(object sender, EventArgs e)
        {
            InsertSQL product = new InsertSQL();

            if (state == "Edit")
            {
                nameText.Text = prodd.Name;
                typeText.Text = prodd.Type;
                quantityNumericUpDown.Text = prodd.Quantity_box.ToString();
                weightText.Text            = prodd.Weight.ToString();
                boxIdText.Text             = prodd.Box_id.ToString();
            }
        }
コード例 #17
0
        private void FormVehicle_Load(object sender, EventArgs e)
        {
            InsertSQL vehicle = new InsertSQL();

            if (state == "Edit")
            {
                nameText.Text              = v11.Name;
                serialNumText.Text         = v11.Serial_number;
                buyDateTimePicker.Text     = v11.Buy_date.ToString();
                serviceDateTimePicker.Text = v11.Last_service_date.ToString();
                remarkText.Text            = v11.Remark.ToString();
            }
        }
コード例 #18
0
        private void addPesticide()
        {
            Pesticide p1 = new Pesticide();

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

            InsertSQL add          = new InsertSQL();
            int       changerecord = add.addNewPesticide(p1);

            MessageBox.Show(changerecord + " Your record is added");
        }
コード例 #19
0
        private void addFertiliser()
        {
            Fertiliser f1 = new Fertiliser();

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

            InsertSQL add       = new InsertSQL();
            int       addrecord = add.addNewFertiliser(f1);

            MessageBox.Show("Seccuess!!");
            this.Close();
        }
コード例 #20
0
ファイル: FormFarm.cs プロジェクト: helloVorld/JustRipeFarm
        public void addFarm()
        {
            Farm f1 = new Farm();

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

            InsertSQL add       = new InsertSQL();
            int       addrecord = add.addNewFarm(f1);

            MessageBox.Show("Successful");
            this.Close();
        }
コード例 #21
0
        public void addCrop()
        {
            Crop crop = new Crop();

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

            InsertSQL add        = new InsertSQL();
            int       editrecord = add.addNewCrop(crop);

            MessageBox.Show(" Your seccusful");
            this.Close();
        }
コード例 #22
0
        public void addVehicle()
        {
            Vehicle vech = new Vehicle();

            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;

            InsertSQL vechHnd   = new InsertSQL();
            int       addrecord = vechHnd.addNewVehicle(vech);

            MessageBox.Show(addrecord + "Your record is added");
        }
コード例 #23
0
ファイル: FormBox.cs プロジェクト: helloVorld/JustRipeFarm
        private void FormBox_Load(object sender, EventArgs e)
        {
            InsertSQL box = new InsertSQL();

            if (state == "Edit")
            {
                textBox1.Text = bb1.Name;
                textBox2.Text = bb1.Width.ToString();
                textBox3.Text = bb1.Height.ToString();
                textBox4.Text = bb1.Length.ToString();
                textBox5.Text = bb1.Max_weight.ToString();
                textBox6.Text = bb1.Quantity.ToString();
                textBox7.Text = bb1.Status;
            }
        }
コード例 #24
0
        private void addCustomer()
        {
            Customer c1 = new Customer();

            c1.Name   = textBox1.Text;
            c1.Email  = textBox2.Text;
            c1.Phone  = textBox3.Text;
            c1.Remark = textBox4.Text;

            InsertSQL add        = new InsertSQL();
            int       editrecord = add.addNewCustomer(c1);

            MessageBox.Show(" Your seccusful");
            this.Close();
        }
コード例 #25
0
        private void add()
        {
            Product prod = new Product();

            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);

            InsertSQL prodHnd   = new InsertSQL();
            int       addrecord = prodHnd.addNewProduct(prod);

            MessageBox.Show("Your record is added");
            this.Close();
        }
コード例 #26
0
 public static bool AddResourceRecord(int blogId, string resourceId, ResourceType type, bool continuted = false)
 {
     try
     {
         IInsertDataSourceFace query = new InsertSQL(TableName.ResourceRecord);
         query.DataBaseAlias = Const.LogConnection;
         query.AddFieldValue("BlogId", blogId);
         query.AddFieldValue("ResourceId", resourceId.Trim());
         query.AddFieldValue("ResourceType", (int)type);
         query.AddFieldValue("Continued", continuted);
         return(query.ExecuteNonQuery() > 0);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(false);
     }
 }
コード例 #27
0
ファイル: FormBox.cs プロジェクト: helloVorld/JustRipeFarm
        private void addBox()
        {
            Box box = new Box();

            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;

            InsertSQL addHnd    = new InsertSQL();
            int       addrecord = addHnd.addNewBox(box);

            MessageBox.Show("Success!!");
            this.Close();
        }
コード例 #28
0
        private void FormEmployee_Load(object sender, EventArgs e)
        {
            InsertSQL farm = new InsertSQL();

            if (state == "Edit")
            {
                firstNameText.Text = emp1.First_name;
                lastNameText.Text  = emp1.Last_name;
                usernameText.Text  = emp1.Username;
                passwordText.Text  = emp1.Password;
                dobText.Text       = emp1.Dob.ToString();
                mobileText.Text    = emp1.Mobile;
                emailText.Text     = emp1.Email;
                adminText.Text     = emp1.Admin.ToString();
                statusText.Text    = emp1.Status;
                remarkText.Text    = emp1.Remark;
            }
        }
コード例 #29
0
 public static bool InitialFetchRecord(ResourceType type)
 {
     try
     {
         IInsertDataSourceFace query = new InsertSQL(TableName.FetchRecord);
         query.DataBaseAlias = Const.LogConnection;
         query.AddFieldValue("ResourceType", (int)type);
         query.AddFieldValue("FetchCount", 0);
         query.AddFieldValue("RequestCount", 0);
         query.AddFieldValue("TimeStamp", DateTime.Now);
         return(query.ExecuteNonQuery() > 0);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(false);
     }
 }
コード例 #30
0
 public static bool Add(ImageUrl image)
 {
     try
     {
         IInsertDataSourceFace query = new InsertSQL(TableName.ImageUrl);
         query.DataBaseAlias = Const.LogConnection;
         query.AddFieldValue("BlogId", image.BlogId);
         query.AddFieldValue("Url", image.Url);
         query.AddFieldValue("TimeStamp", DateTime.Now);
         query.AddFieldValue("YunUrl", image.YunUrl);
         query.AddFieldValue("ImageStatus", image.ImageStatus);
         return(query.ExecuteNonQuery() > 0);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(false);
     }
 }