Esempio n. 1
0
        private void bind()
        {
            Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
            int index = int.Parse(Request.QueryString["ProID"].ToString());

            Maticsoft.Model.Product     promodel  = probll.GetModel(index);
            Maticsoft.BLL.ProductType   typebll   = new Maticsoft.BLL.ProductType();
            Maticsoft.Model.ProductType typemodel = typebll.GetModel(int.Parse(promodel.ProTypeID.ToString()));
            Maticsoft.BLL.ProductXing   xinbll    = new Maticsoft.BLL.ProductXing();
            Maticsoft.Model.ProductXing xinmodel  = xinbll.GetModel(int.Parse(promodel.ProXingID.ToString()));
            lblchutime.Text   = Convert.ToDateTime(promodel.Prochutime.ToString()).ToString("yyyy-MM-dd");
            lblstarttime.Text = Convert.ToDateTime(promodel.Fatime.ToString()).ToString("yyyy-MM-dd");
            lbltitle.Text     = promodel.ProName;
            lbltype.Text      = typemodel.ProTypeTitle;
            lblxinghao.Text   = xinmodel.ProXingTitle;
            Image1.ImageUrl   = promodel.ImageURL;
            txtcontent.Text   = promodel.Procontent;
            if (promodel.Toujian == 1)
            {
                toujian.Visible = false;
            }
            else
            {
                toujian.Visible = true;
            }
        }
Esempio n. 2
0
 protected void datapro_DeleteCommand(object source, DataListCommandEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
     {
         Maticsoft.BLL.Product pronll = new Maticsoft.BLL.Product();
         int proid = int.Parse(datapro.DataKeys[e.Item.ItemIndex].ToString());
         pronll.Delete(proid);
         lblpage.Text = "";
         bind();
     }
 }
Esempio n. 3
0
        protected void btnok_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
            int index = int.Parse(Request.QueryString["ProID"].ToString());

            Maticsoft.Model.Product promodel = probll.GetModel(index);
            promodel.Toujian = 1;
            probll.Update(promodel);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<scripe>alert('推荐成功....')</script>");
            bind();
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
                int recordCount = 0;  //总共有多少条数据
                int pageSize    = 12; //每页大小
                int page        = 1;  //当前第几页
                int pagecount;

                if (Request.QueryString["page"] != null)
                {
                    if (Request.QueryString["page"].ToString() != "")
                    {
                        page = int.Parse(Request.QueryString["page"].ToString());
                    }
                }
                recordCount = probll.getproCount("");
                int pageCont = recordCount / pageSize + 1;
                if (recordCount % pageSize == 0)
                {
                    pageCont--;
                }
                DataSet ds = probll.getproList(pageSize * (page - 1), pageSize, "");
                datapro.DataSource   = ds;
                datapro.DataKeyField = "ProID";
                datapro.DataBind();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    this.lblpage.Text += "共有<b>" + recordCount + "</b>条记录&nbsp; ";
                    this.lblpage.Text += "当前第<b>" + page + "</b>页&nbsp;&nbsp;";
                    if (page == 1)
                    {
                        this.lblpage.Text += "首页&nbsp;";
                        this.lblpage.Text += "上一页&nbsp;";
                    }
                    else
                    {
                        this.lblpage.Text += "<a href='product.aspx?page=" + 1 + "  '>首页</a>&nbsp;";
                        this.lblpage.Text += "<a href='product.aspx?page=" + (page - 1).ToString() + " '>上一页</a>&nbsp;";
                    }
                    if (page == pageCont)
                    {
                        this.lblpage.Text += "下一页&nbsp;";
                        this.lblpage.Text += "尾页&nbsp;";
                    }
                    else
                    {
                        this.lblpage.Text += "<a href='product.aspx?page=" + (page + 1).ToString() + " '>下一页</a>&nbsp;";
                        this.lblpage.Text += "<a href='product.aspx?page=" + pageCont.ToString() + " '>尾页</a>&nbsp;";
                    }
                }
            }
        }
Esempio n. 5
0
 protected void datapro_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
     {
         Maticsoft.BLL.Product pronll = new Maticsoft.BLL.Product();
         int proid = int.Parse(datapro.DataKeys[e.Item.ItemIndex].ToString());
         Maticsoft.Model.Product   promodel = pronll.GetModel(proid);
         Maticsoft.BLL.ProductType typebll  = new Maticsoft.BLL.ProductType();
         int typeid = int.Parse(promodel.ProTypeID.ToString());
         Maticsoft.Model.ProductType typemodel = typebll.GetModel(typeid);
         ((Label)e.Item.FindControl("lbltype")).Text = typemodel.ProTypeTitle;
     }
 }
Esempio n. 6
0
 private void ShowInfo(int ProID)
 {
     Maticsoft.BLL.Product   bll   = new Maticsoft.BLL.Product();
     Maticsoft.Model.Product model = bll.GetModel(ProID);
     this.lblProID.Text      = model.ProID.ToString();
     this.lblProName.Text    = model.ProName;
     this.lblProTypeID.Text  = model.ProTypeID.ToString();
     this.lblProXingID.Text  = model.ProXingID.ToString();
     this.lblProchutime.Text = model.Prochutime.ToString();
     this.lblFatime.Text     = model.Fatime.ToString();
     this.lblToujian.Text    = model.Toujian?"ÊÇ":"·ñ";
     this.lblHitNum.Text     = model.HitNum.ToString();
     this.lblProcontent.Text = model.Procontent;
 }
Esempio n. 7
0
        private void bind()
        {
            Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
            int index = int.Parse(Request.QueryString["ProID"].ToString());

            Maticsoft.Model.Product promodel = probll.GetModel(index);
            txtfatime.Text        = Convert.ToDateTime(promodel.Fatime.ToString()).ToString("yyyy-MM-dd");
            Image1.ImageUrl       = promodel.ImageURL;
            txtprocontent.Text    = promodel.Procontent;
            txtprotitle.Text      = promodel.ProName;
            txttme.Text           = Convert.ToDateTime(promodel.Prochutime.ToString()).ToString("yyyy-MM-dd");
            drptype.SelectedValue = promodel.ProTypeID.ToString();
            drpxing.SelectedValue = promodel.ProXingID.ToString();
        }
Esempio n. 8
0
 private void ShowInfo(int ProID)
 {
     Maticsoft.BLL.Product   bll   = new Maticsoft.BLL.Product();
     Maticsoft.Model.Product model = bll.GetModel(ProID);
     this.lblProID.Text      = model.ProID.ToString();
     this.txtProName.Text    = model.ProName;
     this.txtProTypeID.Text  = model.ProTypeID.ToString();
     this.txtProXingID.Text  = model.ProXingID.ToString();
     this.txtProchutime.Text = model.Prochutime.ToString();
     this.txtFatime.Text     = model.Fatime.ToString();
     this.chkToujian.Checked = model.Toujian;
     this.txtHitNum.Text     = model.HitNum.ToString();
     this.txtProcontent.Text = model.Procontent;
 }
Esempio n. 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["ProID"] != null)
         {
             if (Request.QueryString["ProID"].ToString() != "")
             {
                 int proid = int.Parse(Request.QueryString["ProID"].ToString());
                 Maticsoft.BLL.Product       probll    = new Maticsoft.BLL.Product();
                 Maticsoft.Model.Product     promodel  = probll.GetModel(proid);
                 Maticsoft.BLL.ProductType   typebll   = new Maticsoft.BLL.ProductType();
                 Maticsoft.Model.ProductType typemodel = typebll.GetModel(int.Parse(promodel.ProTypeID.ToString()));
                 Maticsoft.BLL.ProductXing   xingbll   = new Maticsoft.BLL.ProductXing();
                 Maticsoft.Model.ProductXing xingmodel = xingbll.GetModel(int.Parse(promodel.ProXingID.ToString()));
                 lblFatime.Text = Convert.ToDateTime(promodel.Fatime.ToString()).ToString("yyyy-MM-dd");
                 int hitnum = 0;
                 if (promodel.HitNum != null)
                 {
                     promodel.HitNum = promodel.HitNum + 1;
                     probll.Update(promodel);
                     lblHitNum.Text = promodel.HitNum.ToString();
                 }
                 else
                 {
                     promodel.HitNum = 1;
                     probll.Update(promodel);
                     lblHitNum.Text = promodel.HitNum.ToString();
                 }
                 lblProcontent.Text   = promodel.Procontent;
                 lblProName.Text      = promodel.ProName;
                 lblProName1.Text     = promodel.ProName;
                 lblProTypeTitle.Text = typemodel.ProTypeTitle;
                 lblProXingTitle.Text = xingmodel.ProXingTitle;
                 ImgImageURL.ImageUrl = promodel.ImageURL;
             }
             else
             {
                 Response.Redirect("product.aspx");
             }
         }
         else
         {
             Response.Redirect("product.aspx");
         }
     }
 }
Esempio n. 10
0
 protected void btnok_Click(object sender, EventArgs e)
 {
     Maticsoft.BLL.Product   probll   = new Maticsoft.BLL.Product();
     Maticsoft.Model.Product promodel = new Maticsoft.Model.Product();
     if (txtprotitle.Text.Trim() == "")
     {
         lbltitle.Text = "请填写产品名称";
         return;
     }
     promodel.ProName = txtprotitle.Text.Trim();
     lbltitle.Text    = "";
     try
     {
         promodel.ProTypeID = int.Parse(drptype.SelectedValue);
     }
     catch (Exception e1)
     { }
     try
     {
         promodel.ProXingID = int.Parse(drpxing.SelectedValue);
     }
     catch (Exception e2)
     { }
     if (txttme.Text.Trim() == "")
     {
         lblprotime.Text = "请填写产品出品时间";
         return;
     }
     promodel.Prochutime = Convert.ToDateTime(txttme.Text.Trim());
     lblprotime.Text     = "";
     if (txtfatime.Text.Trim() == "")
     {
         lbltime.Text = "请填写发布时间";
         return;
     }
     promodel.Fatime     = Convert.ToDateTime(txtfatime.Text.Trim());
     lbltime.Text        = "";
     promodel.ImageURL   = Image1.ImageUrl;
     promodel.Toujian    = 0;
     promodel.Procontent = txtprocontent.Text.Trim();
     probll.Add(promodel);
     Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息添加成功!')</script>");
     txtprotitle.Text   = string.Empty;
     txttme.Text        = string.Empty;
     txtfatime.Text     = string.Empty;
     txtprocontent.Text = string.Empty;
 }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["usename"] != null)
                {
                    if (Session["usename"].ToString() != "")
                    {
                        //获得服务器名称
                        this.lServerName.Text = Server.MachineName;
                        //获得服务器IP地址
                        this.lServerIP.Text = Request.ServerVariables["LOCAL_ADDR"].ToString();
                        //获得服务器操作系统版本
                        this.lServerOSVersion.Text = Environment.OSVersion.ToString();
                        //获得服务器IIS版本
                        this.lServerIISVersion.Text = Request.ServerVariables["SERVER_SOFTWARE"];
                        //获得DoNET引擎版本
                        this.lServerDotNETVersion.Text = ".NET CLR" + Environment.Version.Major + "." + Environment.Version.Minor + "." + Environment.Version.Build + "." + Environment.Version.Revision;

                        Maticsoft.BLL.NewsInfo newbll = new Maticsoft.BLL.NewsInfo();
                        lblnew.Text = newbll.GetNewCount(" Fatime='" + Convert.ToDateTime(DateTime.Now.ToString()) + "'").ToString();
                        Maticsoft.BLL.NicheInfo nichebll = new Maticsoft.BLL.NicheInfo();
                        lblniche.Text = nichebll.GetnicheCount(" Fatime='" + Convert.ToDateTime(DateTime.Now.ToString()) + "'").ToString();
                        Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
                        lblproduct.Text = probll.getproCount(" Fatime='" + Convert.ToDateTime(DateTime.Now.ToString()) + "'").ToString();
                        Maticsoft.BLL.DingProduct dingbll = new Maticsoft.BLL.DingProduct();
                        lblding.Text = dingbll.GetDingCount(" Dingtime='" + Convert.ToDateTime(DateTime.Now.ToString()) + "'").ToString();
                        Maticsoft.BLL.JobZiJianInfo jobbll = new Maticsoft.BLL.JobZiJianInfo();
                        lblzijian.Text = jobbll.GetzijianCount(" datatime='" + Convert.ToDateTime(DateTime.Now.ToString()) + "'").ToString();
                        Maticsoft.BLL.MessageInfo messbll = new Maticsoft.BLL.MessageInfo();
                        lblyijian.Text = messbll.GetmessCount(" DateTime='" + Convert.ToDateTime(DateTime.Now.ToString()) + "'").ToString();
                    }
                    else
                    {
                        Response.Redirect("login.aspx");
                        Response.End();
                    }
                }
                else
                {
                    Response.Redirect("login.aspx");
                    Response.End();
                }
            }
        }
Esempio n. 12
0
        private void bind()
        {
            Maticsoft.BLL.NewsInfo newbll = new Maticsoft.BLL.NewsInfo();
            DataSet newds = newbll.GetList(7, "", " Fatime desc ");

            datanews.DataSource = newds;
            datanews.DataBind();
            Maticsoft.BLL.NicheInfo nichebll = new Maticsoft.BLL.NicheInfo();
            DataSet nicheds = nichebll.GetList(6, "", "Fatime desc");

            dataniche.DataSource = nicheds;
            dataniche.DataBind();
            Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
            DataSet prods = probll.GetList(4, "", " Fatime desc");

            datapro.DataSource = prods;
            datapro.DataBind();
            Maticsoft.BLL.WeiLanInfo weilanbll = new Maticsoft.BLL.WeiLanInfo();
            DataSet weilands = weilanbll.GetList(6, "", " Fatime desc ");

            dataweilan.DataSource = weilands;
            dataweilan.DataBind();
            DataSet toujiands = probll.GetList(4, " Toujian=1 ", "  Fatime desc");

            datatoujian.DataSource = toujiands;
            datatoujian.DataBind();
            Maticsoft.BLL.ZiXunInfo zixunbll = new Maticsoft.BLL.ZiXunInfo();
            DataSet zixunds = zixunbll.GetList(6, "ZiXundaan is not null", " zixuntime desc ");

            dataxiangmo.DataSource = zixunds;
            dataxiangmo.DataBind();
            Maticsoft.BLL.JiShuInfo jishubll = new Maticsoft.BLL.JiShuInfo();
            DataSet jishuds = jishubll.GetList(6, "", " Fatime desc ");

            datajishu.DataSource = jishuds;
            datajishu.DataBind();
            Maticsoft.BLL.FuWuInfo fuwubll = new Maticsoft.BLL.FuWuInfo();
            DataSet fuwuds = fuwubll.GetList(6, "", "  Fatime desc ");

            datafuwu.DataSource = fuwuds;
            datafuwu.DataBind();
        }
Esempio n. 13
0
        public string Add(HttpContext context)
        {
            /*************基本资料***********/
            string BarCode          = context.Request["BarCode"];
            string Name             = context.Request["Name"];
            string Specifications   = context.Request["Specifications"];
            string ValuationMethods = context.Request["ValuationMethods"];
            string Unit             = context.Request["Unit"];

            if (context.Request["TypeID"] == "")
            {
                return("必须项不能为空!");
            }
            long   TypeID       = Convert.ToInt64(context.Request["TypeID"]);
            long   SeriesID     = Convert.ToInt64(context.Request["SeriesID"]);
            string Attribute    = context.Request["Attribute"];
            string Manufacturer = context.Request["Manufacturer"];
            string Enabled      = context.Request["Enabled"];
            string Install      = context.Request["Install"];
            //decimal BarginPrice = context.Request["BarginPrice"] != "" ? Convert.ToDecimal(context.Request["BarginPrice"]) : 0;
            //decimal StandardPrice = context.Request["StandardPrice"] != "" ? Convert.ToDecimal(context.Request["StandardPrice"]) : 0;
            //decimal MaxStock = context.Request["MaxStock"] != "" ? Convert.ToDecimal(context.Request["MaxStock"]) : 0;
            //decimal MinStock = context.Request["MinStock"] != "" ? Convert.ToDecimal(context.Request["MinStock"]) : 0;
            //decimal ReferencePrice = context.Request["ReferencePrice"] != "" ? Convert.ToDecimal(context.Request["ReferencePrice"]) : 0;
            //decimal PriceTag = context.Request["PriceTag"] != "" ? Convert.ToDecimal(context.Request["PriceTag"]) : 0;
            //decimal MinPrice = context.Request["MinPrice"] != "" ? Convert.ToDecimal(context.Request["MinPrice"]) : 0;
            //decimal Profit = context.Request["Profit"] != "" ? Convert.ToDecimal(context.Request["Profit"]) : 0;
            //string StockProduct = context.Request["StockProduct"];
            //string ProductPurchase = context.Request["ProductPurchase"];
            //decimal SellingCost = context.Request["SellingCost"] != "" ? Convert.ToDecimal(context.Request["SellingCost"]) : 0;
            //decimal SellingPrice = context.Request["SellingPrice"] != "" ? Convert.ToDecimal(context.Request["SellingPrice"]) : 0;
            //decimal SellingProfit = context.Request["SellingProfit"] != "" ? Convert.ToDecimal(context.Request["SellingProfit"]) : 0;
            ///*************预设资料***********/
            //decimal ReferencePriceA = context.Request["ReferencePriceA"] != "" ? Convert.ToDecimal(context.Request["ReferencePriceA"]) : 0;
            //decimal ReferencePriceB = context.Request["ReferencePriceB"] != "" ? Convert.ToDecimal(context.Request["ReferencePriceB"]) : 0;
            //decimal ReferencePriceC = context.Request["ReferencePriceC"] != "" ? Convert.ToDecimal(context.Request["ReferencePriceC"]) : 0;
            //decimal ReferencePriceD = context.Request["ReferencePriceD"] != "" ? Convert.ToDecimal(context.Request["ReferencePriceD"]) : 0;
            //decimal ReferencePriceE = context.Request["ReferencePriceE"] != "" ? Convert.ToDecimal(context.Request["ReferencePriceE"]) : 0;
            //decimal ReferencePriceF = context.Request["ReferencePriceF"] != "" ? Convert.ToDecimal(context.Request["ReferencePriceF"]) : 0;
            //string SellingAward = context.Request["SellingAward"];
            //decimal SellingRoyaltyRate = context.Request["SellingRoyaltyRate"] != "" ? Convert.ToDecimal(context.Request["SellingRoyaltyRate"]) : 0;
            //string PreinstallStock = context.Request["PreinstallStock"];
            //string PreinstallStockArea = context.Request["PreinstallStockArea"];
            string  BulkUnit            = context.Request["BulkUnit"];
            string  Bulk                = context.Request["Bulk"];
            string  PreinstallStockSite = context.Request["PreinstallStockSite"];
            string  WeightUnit          = context.Request["WeightUnit"];
            string  Weight              = context.Request["Weight"];
            decimal PackCount           = context.Request["PackCount"] != "" ? Convert.ToDecimal(context.Request["PackCount"]) : 0;
            //decimal SellingLandTransportation = context.Request["SellingLandTransportation"] != "" ? Convert.ToDecimal(context.Request["SellingLandTransportation"]) : 0;
            //decimal DayLandTransportation = context.Request["DayLandTransportation"] != "" ? Convert.ToDecimal(context.Request["DayLandTransportation"]) : 0;
            //decimal Long = context.Request["Long"] != "" ? Convert.ToDecimal(context.Request["Long"]) : 0;
            //decimal SellingSeaTransportation = context.Request["SellingSeaTransportation"] != "" ? Convert.ToDecimal(context.Request["SellingSeaTransportation"]) : 0;
            //decimal DaySeaTransportation = context.Request["DaySeaTransportation"] != "" ? Convert.ToDecimal(context.Request["DaySeaTransportation"]) : 0;
            //decimal Width = context.Request["Width"] != "" ? Convert.ToDecimal(context.Request["Width"]) : 0;
            //decimal SellingOtherTransportation = context.Request["SellingOtherTransportation"] != "" ? Convert.ToDecimal(context.Request["SellingOtherTransportation"]) : 0;
            //decimal DayOtherTransportation = context.Request["DayOtherTransportation"] != "" ? Convert.ToDecimal(context.Request["DayOtherTransportation"]) : 0;
            //decimal Height = context.Request["Height"] != "" ? Convert.ToDecimal(context.Request["Height"]) : 0;

            string addstr = context.Request.Params["addstr"].Trim();
            List <Model.ProductPriceColorShip> insert = new List <Model.ProductPriceColorShip>();

            insert = JsonSerializerHelper.JSONStringToList <Model.ProductPriceColorShip>(addstr);
            string picFile = context.Request.Params["picFile"].Trim();

            Maticsoft.Model.Product model = new Model.Product();
            model.BarCode          = BarCode;
            model.Name             = Name;
            model.Specifications   = Specifications;
            model.ValuationMethods = ValuationMethods;
            model.Unit             = Unit;
            model.TypeID           = TypeID;
            model.SeriesID         = SeriesID;
            model.Attribute        = Attribute;
            model.Manufacturer     = Manufacturer;
            //model.BarginPrice = BarginPrice;
            //model.StandardPrice = StandardPrice;
            //model.MaxStock = MaxStock;
            //model.MinStock = MinStock;
            //model.ReferencePrice = ReferencePrice;
            //model.PriceTag = PriceTag;
            //model.MinPrice = MinPrice;
            //model.Profit = Profit;
            //model.StockProduct = StockProduct;
            //model.ProductPurchase = ProductPurchase;
            //model.SellingCost = SellingCost;
            //model.SellingPrice = SellingPrice;
            //model.SellingProfit = SellingProfit;
            ///*************预设资料***********/
            //model.ReferencePriceA = ReferencePriceA;
            //model.ReferencePriceB = ReferencePriceB;
            //model.ReferencePriceC = ReferencePriceC;
            //model.ReferencePriceD = ReferencePriceD;
            //model.ReferencePriceE = ReferencePriceE;
            //model.ReferencePriceF = ReferencePriceF;
            //model.SellingAward = SellingAward;
            //model.SellingRoyaltyRate = SellingRoyaltyRate;
            //model.PreinstallStock = PreinstallStock;
            //model.PreinstallStockArea = PreinstallStockArea;
            model.BulkUnit            = BulkUnit;
            model.UnitBulk            = Bulk;
            model.PreinstallStockSite = PreinstallStockSite;
            model.WeightUnit          = WeightUnit;
            model.UnitWeight          = Weight;
            model.PackCount           = PackCount;
            //model.SellingLandTransportation = SellingLandTransportation;
            //model.DayLandTransportation = DayLandTransportation;
            //model.Long = Long;
            //model.SellingSeaTransportation = SellingSeaTransportation;
            //model.DaySeaTransportation = DaySeaTransportation;
            //model.Width = Width;
            //model.SellingOtherTransportation = SellingOtherTransportation;
            //model.DayOtherTransportation = DayOtherTransportation;
            //model.Height = Height;
            model.CreateUser = ((Model.BaseUser)(context.Session["login"])).UserID.ToString();
            model.CreateDate = DateTime.Now;
            model.UpdateUser = ((Model.BaseUser)(context.Session["login"])).UserID.ToString();
            model.UpdateDate = DateTime.Now;
            long id     = 0;
            long result = new Maticsoft.BLL.Product().CheckToAdd(model, insert, picFile);

            if (result == -2)
            {
                return("名称已存在,添加失败!");
            }
            else if (result == -3)
            {
                return("添加失败!");
            }
            else
            {
                id = result;

                return("success");
            }


            //context.Response.Write(BarCode);
        }
Esempio n. 14
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtProName.Text.Trim().Length == 0)
            {
                strErr += "ProName不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtProTypeID.Text))
            {
                strErr += "ProTypeID格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtProXingID.Text))
            {
                strErr += "ProXingID格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(txtProchutime.Text))
            {
                strErr += "Prochutime格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(txtFatime.Text))
            {
                strErr += "Fatime格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtHitNum.Text))
            {
                strErr += "HitNum格式错误!\\n";
            }
            if (this.txtProcontent.Text.Trim().Length == 0)
            {
                strErr += "Procontent不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string   ProName    = this.txtProName.Text;
            int      ProTypeID  = int.Parse(this.txtProTypeID.Text);
            int      ProXingID  = int.Parse(this.txtProXingID.Text);
            DateTime Prochutime = DateTime.Parse(this.txtProchutime.Text);
            DateTime Fatime     = DateTime.Parse(this.txtFatime.Text);
            bool     Toujian    = this.chkToujian.Checked;
            int      HitNum     = int.Parse(this.txtHitNum.Text);
            string   Procontent = this.txtProcontent.Text;

            Maticsoft.Model.Product model = new Maticsoft.Model.Product();
            model.ProName    = ProName;
            model.ProTypeID  = ProTypeID;
            model.ProXingID  = ProXingID;
            model.Prochutime = Prochutime;
            model.Fatime     = Fatime;
            model.Toujian    = Toujian;
            model.HitNum     = HitNum;
            model.Procontent = Procontent;

            Maticsoft.BLL.Product bll = new Maticsoft.BLL.Product();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }