예제 #1
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        var entity = AdminService.UserService.Get(AdminUserID);

        if (TbOldPwd.Text.TrimEnd().ToEncryptStr() != entity.UserPwd)
        {
            MessageDiv.InnerHtml = CommonClass.Alert("当前密码输入错误");
            return;
        }

        if (TbUserPwd.Text.TrimEnd().Length < 6)
        {
            MessageDiv.InnerHtml = CommonClass.Alert("密码长度必须大于6位数");
            return;
        }

        entity.UserPwd = TbUserPwd.Text.Trim().ToEncryptStr();
        if (AdminService.UserService.Update(entity) > 0)
        {
            MessageDiv.InnerHtml = CommonClass.Alert("密码修改成功");
        }
        else
        {
            MessageDiv.InnerHtml = CommonClass.Alert("密码修改失败");
        }
    }
예제 #2
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Employee_InfoCategory model = new TB_Employee_InfoCategory();

        if (ViewState["id"] != null)
        {
            model = EmployeeService.InfoCategoryService.Get(ViewState["id"]);
        }
        model.Name    = TbName.Text;
        model.OrderBy = TbOrderBy.Text.ToInt();
        model.Creater = AdminUserName;

        if (ViewState["id"] == null)
        {
            if (EmployeeService.InfoCategoryService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (EmployeeService.InfoCategoryService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #3
0
    protected void BtnCollection_Click(object sender, EventArgs e)
    {
        if (Request.Cookies["MemberInfo"] == null)
        {
            Response.Redirect("../member/Login.aspx");
        }

        List <Expression> express = new List <Expression>();

        express.Add(new Expression("ProductID", "=", id.ToStr()));
        express.Add(new Expression("MemberID", "=", memberID.ToStr()));

        if (ProductService.CollectionService.Search(express).Count == 0)
        {
            TB_Product_Collection entity = new TB_Product_Collection();
            entity.ProductID = id;
            entity.MemberID  = memberID;
            entity.Url       = Request.Url.ToStr();
            entity.AddDate   = DateTime.Now;
            ProductService.CollectionService.Insert(entity);

            MsgBox.InnerHtml = CommonClass.Alert("商品收藏成功");
        }
        else
        {
            MsgBox.InnerHtml = CommonClass.Alert("您已经将该产品加入收藏,不能重复收藏");
        }
    }
예제 #4
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_System_DictionaryType model = new TB_System_DictionaryType();

        if (ViewState["id"] != null)
        {
            model = SystemService.DictionaryTypeService.Get(ViewState["id"]);
            if (model.Code != TbCode.Text.TrimEnd())
            {
                MessageDiv.InnerHtml = CommonClass.Alert("当前标识已存在,请重新输入");
                return;
            }
        }
        else
        {
            List <Expression> express = new List <Expression>();
            express.Add(new Expression("Code", "=", TbCode.Text.TrimEnd()));
            var list = SystemService.DictionaryTypeService.Search(express);
            if (list.Count > 0)
            {
                MessageDiv.InnerHtml = CommonClass.Alert("当前标识已存在,请重新输入");
                return;
            }
        }
        model.Name    = TbName.Text.Trim();
        model.Code    = TbCode.Text;
        model.OrderBy = TbOrderBy.Text.ToInt();
        model.Creater = AdminUserName;
        model.AddDate = DateTime.Now;
        ISystem_DictionaryType dictionaryType = SystemService.DictionaryTypeService;

        if (ViewState["id"] == null)
        {
            if (dictionaryType.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (dictionaryType.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #5
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Member_Members model = new TB_Member_Members();

        if (ViewState["id"] != null)
        {
            model           = MemberService.MembersService.Get(ViewState["id"]);
            model.MemberPwd = TbUserPwd.Text.Trim().ToEncryptStr();
        }
        model.MemberName    = TbUserName.Text.Trim();
        model.Mobile        = TbMobile.Text;
        model.RealName      = TbRealName.Text;
        model.Email         = TbEmail.Text;
        model.Age           = TbAge.Text.ToInt();
        model.City          = TbCity.Text;
        model.Birthday      = Convert.ToDateTime(TbBirthday.Text);
        model.PhotoUrl      = PhotoUrl.Url;
        model.IsFreeze      = CheckBoxState.Checked == false ? 0 : 1;
        model.LastLoginTime = DateTime.Now;

        IMember_Members members = MemberService.MembersService;

        if (ViewState["id"] == null)
        {
            if (members.Insert(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, AdminUserID, "添加会员" + model.MemberName);

                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (members.Update(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, AdminUserID, "修改会员" + model.MemberName);

                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #6
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Sys_Organizations model = new TB_Sys_Organizations();

        if (ViewState["id"] != null)
        {
            model = SysService.SysOrganizations.Get(ViewState["id"]);
        }
        else
        {
            List <Expression> expression = new List <Expression>();
            expression.Add(new Expression("Code", "=", TbCode.Text.TrimEnd()));
            if (SysService.SysOrganizations.Search(expression).Count > 0)
            {
                MessageDiv.InnerHtml = CommonClass.Alert("此用户已存在,请重新输入");
                return;
            }
        }
        model.Name             = TbName.Text.Trim();
        model.Code             = TbCode.Text.Trim();
        model.ConnectionString = TbConnStr.Text;
        model.State            = CheckBoxState.Checked == false ? 0 : 1;
        model.Creater          = AdminUserName;
        model.CreatedOn        = DateTime.Now;
        ISysOrganizations sysOrgService = SysService.SysOrganizations;

        if (ViewState["id"] == null)
        {
            if (sysOrgService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (sysOrgService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #7
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Info_News model = new TB_Info_News();

        if (ViewState["id"] != null)
        {
            model = InfoService.NewsService.Get(ViewState["id"]);
        }
        model.CategoryId   = DDLCategory.SelectedValue.ToInt();
        model.Title        = TbName.Text;
        model.CategoryCode = InfoService.NewsCategoryService.Get(DDLCategory.SelectedValue).Code;
        model.Remark       = FckRemark.Value;
        model.IsHIdden     = CheckBoxIsHidden.Checked;
        model.IsVouch      = CheckBoxIsVouch.Checked;
        model.Creater      = AdminUserName;

        IInfo_News News = InfoService.NewsService;

        if (ViewState["id"] == null)
        {
            model.AddDate = DateTime.Now;
            if (News.Insert(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, 0, "添加新闻" + model.Title);

                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (News.Update(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, 0, "修改新闻" + model.Title);

                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            idc = DescriptionAttributeHelper.GetEnumDescriptions <DataToCacheHelper.CacheNames>();
        }


        string name = Request["name"];

        if (!string.IsNullOrEmpty(name))
        {
            CachesHelper.RemoveCache(name);
            MessageDiv.InnerHtml = CommonClass.Alert("清理成功");
        }
    }
예제 #9
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Member_Levels model = new TB_Member_Levels();

        if (ViewState["id"] != null)
        {
            model = MemberService.LevelsService.Get(ViewState["id"]);
        }
        model.LevelName   = TbTitle.Text;
        model.Discount    = TbDiscount.Text.ToDecimal();
        model.IsDefault   = CheckIsDefault.Checked;
        model.IsEnableDis = CheckIsEnableDis.Checked;
        model.MinIntegral = TbMinIntegral.Text.ToInt();
        model.AddDate     = DateTime.Now;

        IMember_Levels members = MemberService.LevelsService;

        if (ViewState["id"] == null)
        {
            if (members.Insert(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, AdminUserID, "添加会员级别" + model.LevelName);

                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (members.Update(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, AdminUserID, "修改会员级别" + model.LevelName);

                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #10
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Info_Links model = new TB_Info_Links();

        if (ViewState["id"] != null)
        {
            model = InfoService.LinksService.Get(ViewState["id"]);
        }
        model.Title    = TbTitle.Text;
        model.ImgUrl   = ImgUrl.Url;
        model.Url      = TbLinkUrl.Text;
        model.IsHIdden = CheckBoxIsHidden.Checked;
        model.Creater  = AdminUserName;

        IInfo_Links Links = InfoService.LinksService;

        if (ViewState["id"] == null)
        {
            model.AddDate = DateTime.Now;
            if (Links.Insert(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, 0, "添加友情连接" + model.Title);

                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (Links.Update(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, 0, "修改友情连接" + model.Title);

                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #11
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Project_Task model = ProjectService.TaskService.Get(ViewState["id"]);

        model.State    = DDLStatus.SelectedValue.ToInt();
        model.Reason   = TbReason.Text;
        model.Progress = TbProgress.Text.ToInt();

        if (ProjectService.TaskService.Update(model) == 1)
        {
            MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
        }
        else
        {
            MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
        }
    }
예제 #12
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Info_Page model = new TB_Info_Page();

        if (ViewState["id"] != null)
        {
            model = InfoService.PageService.Get(ViewState["id"]);
        }
        model.Title    = TbTitle.Text;
        model.Remark   = FckRemark.Value;
        model.Code     = TbCode.Text;
        model.IsHIdden = CheckBoxIsHidden.Checked;
        model.Creater  = AdminUserName;

        IInfo_Page Page = InfoService.PageService;

        if (ViewState["id"] == null)
        {
            model.AddDate = DateTime.Now;
            if (Page.Insert(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, 0, "添加单篇页" + model.Title);

                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (Page.Update(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, 0, "修改单篇页" + model.Title);

                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #13
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Info_NewsCategory model = new TB_Info_NewsCategory();

        if (ViewState["id"] != null)
        {
            model = InfoService.NewsCategoryService.Get(ViewState["id"]);
        }
        model.Name    = TbName.Text;
        model.Code    = TbCode.Text;
        model.OrderBy = TbOrderBy.Text.ToInt();
        model.Creater = AdminUserName;

        IInfo_NewsCategory NewsCategory = InfoService.NewsCategoryService;

        if (ViewState["id"] == null)
        {
            model.AddDate = DateTime.Now;
            if (NewsCategory.Insert(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, 0, "添加新闻类别" + model.Name);

                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (NewsCategory.Update(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, 0, "修改新闻类别" + model.Name);

                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #14
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Info_HotSearch model = new TB_Info_HotSearch();

        if (ViewState["id"] != null)
        {
            model = InfoService.HotSearchService.Get(ViewState["id"]);
        }
        model.KeyWord    = TbTitle.Text;
        model.ClickCount = TbCount.Text.ToInt();
        model.OrderBy    = TbOrderBy.Text.ToInt();
        model.Creater    = AdminUserName;

        IInfo_HotSearch HotSearch = InfoService.HotSearchService;

        if (ViewState["id"] == null)
        {
            model.AddDate = DateTime.Now;
            if (HotSearch.Insert(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, 0, "添加热门搜索" + model.KeyWord);

                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (HotSearch.Update(model) == 1)
            {
                //操作日志
                AdminService.LogService.Insert(OperationType.用户操作, 0, "修改热门搜索" + model.KeyWord);

                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #15
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_System_AdverPic model = new TB_System_AdverPic();

        if (ViewState["id"] != null)
        {
            model = SystemService.AdverPicService.Get(ViewState["id"]);
        }
        else
        {
            model.AdverId = Request["adverId"].ToInt();
        }
        model.Name     = TbName.Text.Trim();
        model.PicUrl   = PicUrl.Url;
        model.LinkUrl  = TbLinkUrl.Text;
        model.IsHidden = CheckIsHidden.Checked;
        model.OrderBy  = TbOrderBy.Text.ToInt();
        model.Creater  = AdminUserName;
        model.AddDate  = DateTime.Now;
        ISystem_AdverPic adverPic = SystemService.AdverPicService;

        if (ViewState["id"] == null)
        {
            if (adverPic.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (adverPic.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #16
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Product_Group model = new TB_Product_Group();

        if (ViewState["id"] != null)
        {
            model = ProductService.GroupService.Get(ViewState["id"]);
        }
        model.GroupName  = TbName.Text;
        model.Price      = TbPrice.Text.ToDecimal();
        model.GroupPrice = TbGroupPrice.Text.ToDecimal();
        model.StartDate  = TbStartDate.Text.ToDateTime();
        model.StopDate   = TbStopDate.Text.ToDateTime();
        model.ImgUrl     = ProImg.Url;
        model.GroupDesc  = FckDes.Value;
        model.VouchType  = DDLVouchType.SelectedValue.ToInt();
        model.IsHidden   = CheckBoxIsHidden.Checked;
        model.OrderBy    = TbOrderBy.Text.ToInt();
        model.AddDate    = DateTime.Now;
        model.Creater    = AdminUserName;

        if (ViewState["id"] == null)
        {
            if (ProductService.GroupService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (ProductService.GroupService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Admin_Resources model = new TB_Admin_Resources();

        if (ViewState["id"] != null)
        {
            model = AdminService.ResourcesService.Get(ViewState["id"]);
        }

        model.ResourceName = TbResourceName.Text;
        model.ParentID     = DDLParent.SelectedValue.ToInt();
        model.Url          = TbUrl.Text;
        model.Creater      = AdminUserName;
        model.OrderBy      = TbOrderBy.Text.ToInt();
        model.IsShow       = CheckIsShow.Checked;
        model.AddDate      = DateTime.Now;

        IAdmin_Resources Resources = AdminService.ResourcesService;

        if (ViewState["id"] == null)
        {
            if (Resources.Insert(model) == 1)
            {
                CachesHelper.RemoveCache(DataToCacheHelper.CacheNames.AllResources.ToStr());
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (Resources.Update(model) == 1)
            {
                CachesHelper.RemoveCache(DataToCacheHelper.CacheNames.AllResources.ToStr());
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Sys_Organizations model = new TB_Sys_Organizations();

        if (ViewState["id"] != null)
        {
            model = SysOrganizationsService.OrganizationsService.Get(ViewState["id"]);
        }
        model.DbType       = DDLDbType.SelectedValue;
        model.Name         = TbName.Text.Trim();
        model.Code         = TbCode.Text.Trim();
        model.Server       = TbServer.Text.Trim();
        model.DatabaseName = TbDatabaseName.Text.Trim();
        model.UserName     = TbUserName.Text.Trim();
        model.Password     = TbPassword.Text.Trim();
        model.Port         = TbPort.Text.Trim();
        model.State        = CheckBoxState.Checked ? 0 : 1;
        model.Creater      = AdminUserName;
        model.CreatedOn    = DateTime.Now;

        if (ViewState["id"] == null)
        {
            if (SysOrganizationsService.OrganizationsService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (SysOrganizationsService.OrganizationsService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #19
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Product_Picture model = new TB_Product_Picture();

        if (ViewState["id"] != null)
        {
            model = ProductService.PictureService.Get(ViewState["id"]);
        }
        else
        {
            model.ProID = Request["pid"].ToInt();
        }
        model.Name    = TbName.Text;
        model.PicUrl  = Picture.Url;
        model.OrderBy = TbOrderBy.Text.ToInt();
        model.Creater = AdminUserName;
        model.AddDate = Convert.ToDateTime(TbDate.Text);

        if (ViewState["id"] == null)
        {
            if (ProductService.PictureService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            model.ID = ViewState["id"].ToInt();
            if (ProductService.PictureService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #20
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Product_Brands model = new TB_Product_Brands();

        if (ViewState["id"] != null)
        {
            model = ProductService.BrandsService.Get(ViewState["id"]);
        }
        model.TypeID      = DDLType.SelectedValue.ToInt();
        model.BrandName   = TbName.Text.Trim();
        model.IsHidden    = CheckBoxHidden.Checked;
        model.VouchType   = CheckBoxVouch.Checked == false ? 0 : 1;
        model.PicUrl      = ImgUrl.Url;
        model.Description = TbDesc.Text;
        model.ParentID    = 0;
        model.Creater     = AdminUserName;
        model.AddDate     = DateTime.Now;
        IProduct_Brands brandService = ProductService.BrandsService;

        if (ViewState["id"] == null)
        {
            if (brandService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (brandService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #21
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Employee_WorkStatement model = new TB_Employee_WorkStatement();

        if (ViewState["id"] != null)
        {
            model = EmployeeService.WorkStatementService.Get(ViewState["id"]);
        }
        model.Creater = AdminUserName;

        model.Title         = TbTitle.Text.TrimEnd();
        model.Type          = DDLType.SelectedValue.ToInt();
        model.WorkPlan      = TbWorkPlan.Text;
        model.WorkSummary   = TbWorkSummary.Text;
        model.StatementDate = TbStatementDate.Text.ToDateTime();

        model.Creater = AdminUserName;

        if (ViewState["id"] == null)
        {
            if (EmployeeService.WorkStatementService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (EmployeeService.WorkStatementService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #22
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        ExamVisionSubject model = new ExamVisionSubject();

        if (ViewState["id"] != null)
        {
            model = VisionService.ExamVisionSubjectService.Get(ViewState["id"]);
        }
        model.Type        = DDLModule.SelectedValue;
        model.Name        = TbName.Text;
        model.Result      = TbResult.Text;
        model.OrderBy     = TbOrderBy.Text.ToInt();
        model.PicUrl      = Picture.Url;
        model.Description = FckDesc.Value;
        model.Creater     = AdminUserName;
        model.CreatedOn   = DateTime.Now;

        if (ViewState["id"] == null)
        {
            if (VisionService.ExamVisionSubjectService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            model.ID = ViewState["id"].ToInt();
            if (VisionService.ExamVisionSubjectService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #23
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Excel_Fields model = new TB_Excel_Fields();

        if (ViewState["id"] != null)
        {
            model = SystemService.ExcelFieldsService.Get(ViewState["id"]);
        }

        model.ModelID     = DDLModel.SelectedValue.ToInt();
        model.FieldName   = TbFieldName.Text.Trim();
        model.ChineseName = TbChineseName.Text;
        model.Type        = ((CbExport.Checked ? "0," : "") + (CbImport.Checked ? "1," : "")).TrimEnd(',');
        model.OrderBy     = TbOrderBy.Text.ToInt();
        model.Creater     = AdminUserName;
        model.AddDate     = DateTime.Now;
        IExcel_Fields Excel = SystemService.ExcelFieldsService;

        if (ViewState["id"] == null)
        {
            if (Excel.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (Excel.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #24
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_System_Adver model = new TB_System_Adver();

        if (ViewState["id"] != null)
        {
            model.ID = ViewState["id"].ToInt();
        }
        model.ProCategoryId = Request["categoryId"].ToInt();
        model.AdverType     = DDLAdverType.SelectedValue.ToInt();
        model.PicWidth      = TbWidth.Text;
        model.PicHeight     = TbHeight.Text;
        model.Creater       = AdminUserName;
        model.AddDate       = DateTime.Now;

        ISystem_Adver Adver = SystemService.AdverService;

        if (ViewState["id"] == null)
        {
            if (Adver.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (Adver.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #25
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Order_Payment model = new TB_Order_Payment();

        if (ViewState["id"] != null)
        {
            model = OrderService.PaymentService.Get(ViewState["id"]);
        }

        model.PaymentTitle = TbName.Text.Trim();
        model.OrderBy      = TbOrderBy.Text.ToInt();
        model.PaymentNote  = TbDesc.Text;

        IOrder_Payment paymentService = OrderService.PaymentService;

        if (ViewState["id"] == null)
        {
            if (paymentService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            model.ID = ViewState["id"].ToInt();
            if (paymentService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #26
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Product_Reply model = new TB_Product_Reply();

        if (ViewState["id"] != null)
        {
            model = ProductService.ReplyService.Get(ViewState["id"]);
        }
        else
        {
            model.QuestionID = Request["qid"].ToInt();
        }
        model.MemberID   = AdminUserID;
        model.ComContent = TbContent.Text;
        model.AddDate    = DateTime.Now;

        if (ViewState["id"] == null)
        {
            if (ProductService.ReplyService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (ProductService.ReplyService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #27
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Product_Properties model = new TB_Product_Properties();

        if (ViewState["id"] != null)
        {
            model = ProductService.PropertiesService.Get(ViewState["id"]);
        }
        model.ProCategoryId = ProductCategory.CategoryId;
        model.PropName      = TbName.Text;
        model.PropType      = DDLPropType.SelectedValue.ToInt();
        model.OrderBy       = TbOrderBy.Text.ToInt();
        model.PropValue     = TbPropValue.Text;
        model.Creater       = AdminUserName;
        model.AddDate       = Convert.ToDateTime(TbDate.Text);

        if (ViewState["id"] == null)
        {
            if (ProductService.PropertiesService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (ProductService.PropertiesService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #28
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Excel_Model model = new TB_Excel_Model();

        if (ViewState["id"] != null)
        {
            model = SystemService.ExcelModelService.Get(ViewState["id"]);
        }
        model.ModelName = TbModelName.Text.Trim();
        model.TableName = TbTableName.Text;
        model.OrderBy   = TbOrderBy.Text.ToInt();
        model.Creater   = AdminUserName;
        model.AddDate   = DateTime.Now;
        IExcel_Model Excel = SystemService.ExcelModelService;

        if (ViewState["id"] == null)
        {
            if (Excel.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (Excel.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #29
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        ExamPrinciple model = new ExamPrinciple();

        if (ViewState["id"] != null)
        {
            model = BasicService.ExamPrincipleService.Get(ViewState["id"]);
        }
        model.Module      = DDLModule.SelectedValue;
        model.PicUrl      = Picture.Url;
        model.Description = FckDesc.Value;
        model.Creater     = AdminUserName;
        model.CreatedOn   = DateTime.Now;

        if (ViewState["id"] == null)
        {
            if (BasicService.ExamPrincipleService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            model.ID = ViewState["id"].ToInt();
            if (BasicService.ExamPrincipleService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }
예제 #30
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Project_Task model = new TB_Project_Task();

        if (ViewState["id"] != null)
        {
            model = ProjectService.TaskService.Get(ViewState["id"]);
        }
        model.Name      = TbName.Text;
        model.StartDate = TbStartDate.Text.ToDateTime();
        model.EndDate   = TbEndDate.Text.ToDateTime();
        model.Remark    = FckDesc.Value;
        model.Handler   = DDLHandler.SelectedValue.ToInt();
        model.ProjectID = DDLProject.SelectedValue.ToInt();

        if (ViewState["id"] == null)
        {
            if (ProjectService.TaskService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (ProjectService.TaskService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }