Exemple #1
0
    private void EditSavePage()
    {
        int    id     = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误"));
        string Brand  = Utils.GetRequest("Brand", "post", 2, @"^[\s\S]{1,50}$", "手机品牌填写错误");
        string Model  = Utils.GetRequest("Model", "post", 2, @"^[\s\S]{1,50}$", "手机型号填写错误");
        string System = Utils.GetRequest("System", "post", 2, @"^[\s\S]{1,50}$", "操作系统填写错误");
        string Size   = Utils.GetRequest("Size", "post", 2, @"^[\s\S]{1,50}$", "主屏分辨率分填写错误");

        if (!new BCW.BLL.Modata().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }
        BCW.Model.Modata model = new BCW.Model.Modata();
        model.ID          = id;
        model.PhoneBrand  = Brand;
        model.PhoneModel  = Model;
        model.PhoneSystem = System;
        model.PhoneSize   = Size;
        new BCW.BLL.Modata().Update(model);

        Utils.Success("修改机型", "修改手机型号成功..", Utils.getPage("modata.aspx"), "2");
    }
Exemple #2
0
    private void SavePage()
    {
        string Brand  = Utils.GetRequest("Brand", "post", 2, @"^[\s\S]{1,50}$", "手机品牌填写错误");
        string Model  = Utils.GetRequest("Model", "post", 2, @"^[\s\S]{1,50}$", "手机型号填写错误");
        string System = Utils.GetRequest("System", "post", 2, @"^[\s\S]{1,50}$", "操作系统填写错误");
        string Size   = Utils.GetRequest("Size", "post", 2, @"^[\s\S]{1,50}$", "主屏分辨率分填写错误");

        int Types = new BCW.BLL.Modata().GetTypes(Brand);

        if (Types == 0)
        {
            Types = new BCW.BLL.Modata().GetMaxTypes();
        }
        BCW.Model.Modata model = new BCW.Model.Modata();
        model.Types       = Types;
        model.PhoneBrand  = Brand;
        model.PhoneModel  = Model;
        model.PhoneSystem = System;
        model.PhoneSize   = Size;
        new BCW.BLL.Modata().Add(model);

        Utils.Success("添加机型", "添加手机型号成功..", Utils.getUrl("modata.aspx"), "2");
    }
Exemple #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BCW.Model.Modata model)
 {
     dal.Update(model);
 }
Exemple #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(BCW.Model.Modata model)
 {
     dal.Add(model);
 }