Example #1
0
        protected void SaveInfo()
        {
            Seed_Info info = new Seed_Info(int.Parse(txtKey.Text));

            info.SeedsName   = txtSeedsName.Text;
            info.CategoryKey = 1;// int.Parse(DLLCategoryID.SelectedValue);
            info.CompanyKey  = int.Parse(DLLCompany.SelectedValue);
            info.StatusKey   = int.Parse(rdbStatus.SelectedValue);
            info.SeasonKey   = int.Parse(DLLSeason.SelectedValue);
            if (FileUploadKML.HasFile)
            {
                try
                {
                    FileUploadKML.SaveAs(Server.MapPath("~/Img/Seeds/") + info.SeedsKey.ToString() + ".png");
                    info.Images = "../Img/Seeds/" + info.SeedsKey.ToString() + ".png";
                }
                catch (Exception ex)
                {
                }
            }
            else
            {
                info.Images = "../Img/Seeds/Default.png";
            }
            info.TypeKey = int.Parse(DDLType.SelectedValue);
            info.Detail  = txtDetail.Text;
            info.Save();
        }
Example #2
0
        protected void SaveInfo()
        {
            Pesticide_Info info = new Pesticide_Info(int.Parse(txtKey.Text));

            info.Trade_Name  = txtTradeName.Text;
            info.Crop_Name   = txtCropName.Text;
            info.Common_Key  = int.Parse(DLLCommon.SelectedValue);
            info.CompanyKey  = int.Parse(DLLCompany.SelectedValue);
            info.UsingStatus = int.Parse(rdbStatus.SelectedValue);
            info.CategoryKey = 1;
            if (FileUploadKML.HasFile)
            {
                try
                {
                    FileUploadKML.SaveAs(Server.MapPath("~/Img/Pesticides/") + info.PesticideKey.ToString() + ".png");
                    info.Images = "../Img/Pesticides/" + info.PesticideKey.ToString() + ".png";
                }
                catch (Exception ex)
                {
                }
            }
            else
            {
                info.Images = "../Img/Pesticides/Default.png";
            }
            info.Save();
        }
Example #3
0
        protected void SaveInfo()
        {
            Fertilizer_Info info = new Fertilizer_Info(int.Parse(txtKey.Text));

            info.TradeName = txtTrade.Text;

            if (int.Parse(DLLUnit.SelectedValue) == 0)
            {
                info.UnitKey = 1;
            }
            else
            {
                info.UnitKey = int.Parse(DLLUnit.SelectedValue);
            }
            if (int.Parse(DLLCommon.SelectedValue) == 0)
            {
                info.CommonKey = 217;
            }
            else
            {
                info.CommonKey = int.Parse(DLLCommon.SelectedValue);
            }

            info.CompanyKey  = int.Parse(DLLCompany.SelectedValue);
            info.CategoryKey = int.Parse(DLLCategoryID.SelectedValue);
            if (FileUploadKML.HasFile)
            {
                try
                {
                    FileUploadKML.SaveAs(Server.MapPath("~/Img/Fertilizer/") + info.FertilizersKey.ToString() + ".png");
                    info.Images = "../Img/Fertilizer/" + info.FertilizersKey.ToString() + ".png";
                }
                catch (Exception ex)
                {
                }
            }
            else
            {
                info.Images = "../Img/Fertilizer/Default.png";
            }
            info.Save();
        }