示例#1
0
 private void CreateModel(global::Drision.Framework.Entity.T_Product entityModel)
 {
     entityModel.SetPropertyConvertValue("Product_Name", tbProduct_Name.GetValue());
     entityModel.SetPropertyConvertValue("Img", txtImgVB.GetValue());
     entityModel.SetPropertyConvertValue("Url", txtUrlAZ.GetValue());
     entityModel.SetPropertyConvertValue("ProductSummary", txtProductSummary5X.GetValue());
     entityModel.SetPropertyConvertValue("DesignStyle", txtDesignStyleJM.GetValue());
     entityModel.SetPropertyConvertValue("Designers", txtDesigners3W.GetValue());
     entityModel.SetPropertyConvertValue("Area", txtArea3D.GetValue());
     entityModel.SetPropertyConvertValue("ProductTypeId", ddlProductTypeIdYW.GetValue());
 }
示例#2
0
 private void CreateModel(global::Drision.Framework.Entity.T_Product entityModel)
 {
     entityModel.SetPropertyConvertValue("Product_Name", tbProduct_Name.GetValue());
     entityModel.SetPropertyConvertValue("Img", txtImgEV.GetValue());
     entityModel.SetPropertyConvertValue("Url", txtUrlX6.GetValue());
     entityModel.SetPropertyConvertValue("ProductSummary", txtProductSummaryCR.GetValue());
     entityModel.SetPropertyConvertValue("State", txtStateFY.GetValue());
     entityModel.SetPropertyConvertValue("DesignStyle", txtDesignStyleA6.GetValue());
     entityModel.SetPropertyConvertValue("Designers", txtDesignersT8.GetValue());
     entityModel.SetPropertyConvertValue("Area", txtAreaHS.GetValue());
     entityModel.SetPropertyConvertValue("ProductTypeId", ddlProductTypeIdEN.GetValue());
 }
示例#3
0
/// <summary>
/// 保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string __RedirectURL = string.Empty;
                ButtonOperationContext __ButtonOperationContext        = new ButtonOperationContext();
                global::Drision.Framework.Entity.T_Product entityModel = null;
                entityModel = new global::Drision.Framework.Entity.T_Product();
                CreateModel(entityModel);
                PluginEventArgs __PluginEventArg = new PluginEventArgs()
                {
                    entityModel = entityModel, RedirectURL = __RedirectURL, CurrentUserID = this.LoginUserID
                };
                {
                    #region  钮前插件
                    if (!__ButtonOperationContext.IsEnd)
                    {
                        try
                        {
                            PagePluginFactory.InvokeBeforePlugins(sender, __PluginEventArg);
                            __ButtonOperationContext.RedirectURL = __PluginEventArg.RedirectURL;
                            if (!string.IsNullOrEmpty(__ButtonOperationContext.RedirectURL))
                            {
                                __ButtonOperationContext.IsEnd = true;
                            }
                        }
                        catch (MessageException ex)
                        {
                            __ButtonOperationContext.IsEnd        = true;
                            __ButtonOperationContext.AlertMessage = ex.Message;
                        }
                    }
                    #endregion

                    #region 框架自己操作
                    if (!__ButtonOperationContext.IsEnd)
                    {
                        this.GenericHelper.Save(entityModel);
                        __Id = entityModel.Product_Id;
                    }
                    #endregion
                    #region  钮后插件
                    if (!__ButtonOperationContext.IsEnd)
                    {
                        try
                        {
                            PagePluginFactory.InvokeAfterPlugins(sender, __PluginEventArg);
                            __ButtonOperationContext.RedirectURL = __PluginEventArg.RedirectURL;
                            if (!string.IsNullOrEmpty(__ButtonOperationContext.RedirectURL))
                            {
                                __ButtonOperationContext.IsEnd = true;
                            }
                        }
                        catch (MessageException ex)
                        {
                            __ButtonOperationContext.IsEnd        = true;
                            __ButtonOperationContext.AlertMessage = ex.Message;
                        }
                    }
                    #endregion
                    //结束事务
                    #region 最后处理
                    if (__ButtonOperationContext.IsEnd)
                    {
                        if (!string.IsNullOrEmpty(__ButtonOperationContext.AlertMessage))
                        {
                            this.AjaxAlert(__ButtonOperationContext.AlertMessage, "EnableButton();");
                            return;
                        }
                        if (!string.IsNullOrEmpty(__ButtonOperationContext.RedirectURL))
                        {
                            Response.Redirect(__ButtonOperationContext.RedirectURL);
                            return;
                        }
                    }
                    #endregion
                }


                __RedirectURL = DequeueLastUrl("id", __Id); //2013-11-13 V3.0


                //如果没有id就加上id
                __RedirectURL = AppendQueryStringToUrl(__RedirectURL, "id", __Id);//2013-11-13 V3.0

                Response.Redirect(__RedirectURL, false);
            }
            catch (Exception ex)
            {
                DrisionLog.Add(ex);
                this.AjaxAlert(ex, "EnableButton();");
            }
        }