Esempio n. 1
0
        protected void pageSave(string doType)
        {
            string id    = Utils.GetQueryStringValue("id");
            var    model = new Eyousoft_yhq.Model.Product();

            #region 实体赋值

            model.ProductName = Utils.GetFormValue(txtproductName.UniqueID);
            model.ProductType = 0;
            model.TourDate    = Utils.GetDateTimeNullable(Utils.GetFormValue(txtsendDate.UniqueID));
            model.MarketPrice = Utils.GetDecimal(Utils.GetFormValue(txtmarkPrice.UniqueID));
            model.AppPrice    = Utils.GetDecimal(Utils.GetFormValue(txtappPrice.UniqueID));
            //model.FavourCode = Utils.GetFormValue(txtcoupons.UniqueID);
            model.LinkTel       = Utils.GetFormValue(txttel.UniqueID);
            model.ProductDis    = Utils.GetFormValue(txtdescript.UniqueID);
            model.TourDis       = Utils.GetFormValue(txtStation.UniqueID);
            model.SendTourKnow  = Utils.GetFormValue(txtjoury.UniqueID);
            model.ValidiDate    = Utils.GetDateTime(Utils.GetFormValue(txtValidate.UniqueID));
            model.ProductState  = 0;
            model.AttachList    = NewGetAttach();
            model.IsEveryDay    = false;
            model.IsHot         = 0;
            model.ServiceQQ     = Utils.GetFormValue(txtkfqq.UniqueID);
            model.ContractType  = Model.ContractType.车票;
            model.ControlPeople = Utils.GetInt(Utils.GetFormValue(txtPeopleNum.UniqueID));
            model.FavourCode    = Utils.GetFormValue(txtWXcode.UniqueID);

            model.ProductSdate   = Utils.GetDateTime(Utils.GetFormValue(txtsendsDate.UniqueID));
            model.ProductOpState = (Model.ProductOp)Utils.GetInt(Utils.GetFormValue(ddl_proType.UniqueID));
            model.ZCodeViaDate   = Utils.GetDateTime(Utils.GetFormValue(txtZxingdate.UniqueID));
            model.PType          = 3;
            #endregion

            cn.myvo.smc.Service sms = new cn.myvo.smc.Service();
            string IsContact        = sms.IsIncludeKeyWord(model.ProductName);

            #region 提交保存
            bool   result = false;
            string msg    = "";

            if (string.IsNullOrEmpty(IsContact))
            {
                Response.Clear();
                Eyousoft_yhq.BLL.Product BLL = new Eyousoft_yhq.BLL.Product();
                if (doType == "add")
                {
                    result = BLL.Add(model);
                    msg    = result ? "添加成功!" : "添加失败!";
                    Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                }
                else
                {
                    model.ProductID = id;
                    result          = BLL.Update(model);
                    msg             = result ? "修改成功!" : "修改失败!";
                    Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                }
                Response.End();
            }
            else
            {
                msg = "产品名称包含敏感字符[" + IsContact + "],请修改后再保存!";
                Response.Clear();
                Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                Response.End();
            }
            #endregion
        }
Esempio n. 2
0
        protected void pageSave(string doType)
        {
            string id    = Utils.GetQueryStringValue("id");
            var    model = new Eyousoft_yhq.Model.Product();

            #region 实体赋值

            model.ProductName   = Utils.GetFormValue(txtproductName.UniqueID);
            model.ProductType   = Utils.GetInt(Utils.GetFormValue(ddltype.UniqueID));
            model.TourDate      = Utils.GetDateTimeNullable(Utils.GetFormValue(txtsendDate.UniqueID));
            model.MarketPrice   = Utils.GetDecimal(Utils.GetFormValue(txtmarkPrice.UniqueID));
            model.AppPrice      = Utils.GetDecimal(Utils.GetFormValue(txtappPrice.UniqueID));
            model.LinkTel       = Utils.GetFormValue(txttel.UniqueID);
            model.ProductDis    = Utils.GetFormValue(txtdescript.UniqueID);
            model.TourDis       = Utils.GetFormValue(txtjoury.UniqueID);
            model.SendTourKnow  = Utils.GetFormValue(txtsendMark.UniqueID);
            model.Scompare      = Utils.GetFormValue(txtScompare.UniqueID);
            model.ValidiDate    = Utils.GetDateTime(Utils.GetFormValue(txtValidate.UniqueID));
            model.ProductState  = 0;
            model.AttachList    = NewGetAttach();
            model.IsEveryDay    = Utils.GetFormValue("isEvery") == "1" ? true : false;
            model.IsHot         = Utils.GetInt(Utils.GetFormValue(ddl_isHot.UniqueID));
            model.ServiceQQ     = Utils.GetFormValue(txtkfqq.UniqueID);
            model.ContractType  = (Model.ContractType)Utils.GetInt(Utils.GetFormValue(ddl_contact.UniqueID));
            model.ControlPeople = Utils.GetInt(Utils.GetFormValue(txtPeopleNum.UniqueID));

            model.ProductOpState = (Model.ProductOp)Utils.GetInt(Utils.GetFormValue(ddl_proType.UniqueID));
            model.ZCodeViaDate   = Utils.GetDateTime(Utils.GetFormValue(txtZxingdate.UniqueID));
            model.PType          = 1;
            model.ProductSdate   = DateTime.Now;
            model.FavourCode     = Utils.GetFormValue(txtWXcode.UniqueID);

            model.FaBuRenId    = HuiYuanInfo.UserId;
            model.ShenHeStatus = Eyousoft_yhq.Model.ChanPinShenHeStatus.已审核;
            if (HuiYuanInfo.LeiXing == Eyousoft_yhq.Model.WebmasterLeiXing.供应商)
            {
                model.ShenHeStatus = Eyousoft_yhq.Model.ChanPinShenHeStatus.未审核;
            }
            #endregion



            if (new Eyousoft_yhq.BLL.Product().Exists(model))
            {
                Response.Clear();
                Response.Write(UtilsCommons.AjaxReturnJson("0", "此微信码已被使用"));
                Response.End();
            }

            cn.myvo.smc.Service sms = new cn.myvo.smc.Service();
            string IsContact        = sms.IsIncludeKeyWord(model.ProductName);
            #region 提交保存
            bool   result = false;
            string msg    = "";

            if (string.IsNullOrEmpty(IsContact))
            {
                Response.Clear();
                Eyousoft_yhq.BLL.Product BLL = new Eyousoft_yhq.BLL.Product();
                if (doType == "add")
                {
                    result = BLL.Add(model);
                    msg    = result ? "添加成功!" : "添加失败!";
                    Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                }
                else
                {
                    model.ProductID = id;
                    result          = BLL.Update(model);
                    msg             = result ? "修改成功!" : "修改失败!";
                    Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                }
                Response.End();
            }
            else
            {
                msg = "产品名称包含敏感字符[" + IsContact + "],请修改后再保存!";
                Response.Clear();
                Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                Response.End();
            }
            #endregion
        }
Esempio n. 3
0
        protected void pageSave(string doType)
        {
            string id = Utils.GetQueryStringValue("id");
            var model = new Eyousoft_yhq.Model.Product();

            #region 实体赋值

            model.ProductName = Utils.GetFormValue(txtproductName.UniqueID);
            model.ProductType = Utils.GetInt(Utils.GetFormValue(ddltype.UniqueID));
            model.TourDate = Utils.GetDateTimeNullable(Utils.GetFormValue(txtsendDate.UniqueID));
            model.MarketPrice = Utils.GetDecimal(Utils.GetFormValue(txtmarkPrice.UniqueID));
            model.AppPrice = Utils.GetDecimal(Utils.GetFormValue(txtappPrice.UniqueID));
            model.LinkTel = Utils.GetFormValue(txttel.UniqueID);
            model.ProductDis = Utils.GetFormValue(txtdescript.UniqueID);
            model.TourDis = Utils.GetFormValue(txtjoury.UniqueID);
            model.SendTourKnow = Utils.GetFormValue(txtsendMark.UniqueID);
            model.Scompare = Utils.GetFormValue(txtScompare.UniqueID);
            model.ValidiDate = Utils.GetDateTime(Utils.GetFormValue(txtValidate.UniqueID));
            model.ProductState = 0;
            model.AttachList = NewGetAttach();
            model.IsEveryDay = Utils.GetFormValue("isEvery") == "1" ? true : false;
            model.IsHot = Utils.GetInt(Utils.GetFormValue(ddl_isHot.UniqueID));
            model.ServiceQQ = Utils.GetFormValue(txtkfqq.UniqueID);
            model.ContractType = (Model.ContractType)Utils.GetInt(Utils.GetFormValue(ddl_contact.UniqueID));
            model.ControlPeople = Utils.GetInt(Utils.GetFormValue(txtPeopleNum.UniqueID));

            model.ProductOpState = (Model.ProductOp)Utils.GetInt(Utils.GetFormValue(ddl_proType.UniqueID));
            model.ZCodeViaDate = Utils.GetDateTime(Utils.GetFormValue(txtZxingdate.UniqueID));
            model.PType = 1;
            model.ProductSdate = DateTime.Now;
            model.FavourCode = Utils.GetFormValue(txtWXcode.UniqueID);

            model.FaBuRenId = HuiYuanInfo.UserId;
            model.ShenHeStatus = Eyousoft_yhq.Model.ChanPinShenHeStatus.已审核;
            if (HuiYuanInfo.LeiXing == Eyousoft_yhq.Model.WebmasterLeiXing.供应商)
            {
                model.ShenHeStatus = Eyousoft_yhq.Model.ChanPinShenHeStatus.未审核;
            }
            #endregion

            if (new Eyousoft_yhq.BLL.Product().Exists(model))
            {
                Response.Clear();
                Response.Write(UtilsCommons.AjaxReturnJson("0", "此微信码已被使用"));
                Response.End();
            }

            cn.myvo.smc.Service sms = new cn.myvo.smc.Service();
            string IsContact = sms.IsIncludeKeyWord(model.ProductName);
            #region 提交保存
            bool result = false;
            string msg = "";

            if (string.IsNullOrEmpty(IsContact))
            {
                Response.Clear();
                Eyousoft_yhq.BLL.Product BLL = new Eyousoft_yhq.BLL.Product();
                if (doType == "add")
                {
                    result = BLL.Add(model);
                    msg = result ? "添加成功!" : "添加失败!";
                    Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                }
                else
                {
                    model.ProductID = id;
                    result = BLL.Update(model);
                    msg = result ? "修改成功!" : "修改失败!";
                    Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                }
                Response.End();
            }
            else
            {
                msg = "产品名称包含敏感字符[" + IsContact + "],请修改后再保存!";
                Response.Clear();
                Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                Response.End();
            }
            #endregion
        }
Esempio n. 4
0
        protected void pageSave(string doType)
        {
            string id = Utils.GetQueryStringValue("id");
            var model = new Eyousoft_yhq.Model.Product();

            #region 实体赋值

            model.ProductName = Utils.GetFormValue(txtproductName.UniqueID);
            model.ProductType = 0;
            model.TourDate = Utils.GetDateTimeNullable(Utils.GetFormValue(txtsendDate.UniqueID));
            model.MarketPrice = Utils.GetDecimal(Utils.GetFormValue(txtmarkPrice.UniqueID));
            model.AppPrice = Utils.GetDecimal(Utils.GetFormValue(txtappPrice.UniqueID));
            //model.FavourCode = Utils.GetFormValue(txtcoupons.UniqueID);
            model.FavourCode = Utils.GetFormValue(txtWXcode.UniqueID);
            model.LinkTel = Utils.GetFormValue(txttel.UniqueID);
            model.ProductDis = Utils.GetFormValue(txtdescript.UniqueID);
            model.TourDis = Utils.GetFormValue(txtStation.UniqueID);
            model.SendTourKnow = Utils.GetFormValue(txtjoury.UniqueID);
            model.ValidiDate = Utils.GetDateTime(Utils.GetFormValue(txtValidate.UniqueID));
            model.ProductState = 0;
            model.AttachList = NewGetAttach();
            model.IsEveryDay = false;
            model.IsHot = 0;
            model.ServiceQQ = Utils.GetFormValue(txtkfqq.UniqueID);
            model.ContractType = Model.ContractType.车票;
            model.ControlPeople = Utils.GetInt(Utils.GetFormValue(txtPeopleNum.UniqueID));

            model.ProductSdate = Utils.GetDateTime(Utils.GetFormValue(txtsendsDate.UniqueID));
            model.ProductOpState = (Model.ProductOp)Utils.GetInt(Utils.GetFormValue(ddl_proType.UniqueID));
            model.ZCodeViaDate = Utils.GetDateTime(Utils.GetFormValue(txtZxingdate.UniqueID));
            model.PType = 2;
            #endregion

            cn.myvo.smc.Service sms = new cn.myvo.smc.Service();
            string IsContact = sms.IsIncludeKeyWord(model.ProductName);

            #region 提交保存
            bool result = false;
            string msg = "";

            if (string.IsNullOrEmpty(IsContact))
            {
                Response.Clear();
                Eyousoft_yhq.BLL.Product BLL = new Eyousoft_yhq.BLL.Product();
                if (doType == "add")
                {
                    result = BLL.Add(model);
                    msg = result ? "添加成功!" : "添加失败!";
                    Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                }
                else
                {
                    model.ProductID = id;
                    result = BLL.Update(model);
                    msg = result ? "修改成功!" : "修改失败!";
                    Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                }
                Response.End();
            }
            else
            {
                msg = "产品名称包含敏感字符[" + IsContact + "],请修改后再保存!";
                Response.Clear();
                Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                Response.End();
            }
            #endregion
        }