Пример #1
0
    //加载
    public void LoadDataBind()
    {
        DDLModel.DataSource     = SystemService.AdverCategoryService.Search();
        DDLModel.DataTextField  = "Name";
        DDLModel.DataValueField = "ID";
        DDLModel.DataBind();

        int id = CommonClass.ReturnRequestInt("id", 0);

        if (id > 0)
        {
            TB_System_Adver model = SystemService.AdverService.Get(id);
            if (model != null)
            {
                DDLModel.SelectedValue     = model.CategoryId.ToStr();
                TbName.Text                = model.Name;
                TbCode.Text                = model.Code;
                DDLAdverType.SelectedValue = model.AdverType.ToStr();
                TbWidth.Text               = model.PicWidth;
                TbHeight.Text              = model.PicHeight;
                TbRemark.Text              = model.Remark;
                TbOrderBy.Text             = model.OrderBy.ToStr();
                ViewState["id"]            = model.ID;
            }
        }
    }
Пример #2
0
    //加载
    public void LoadDataBind()
    {
        DDLModel.DataSource     = SystemService.DictionaryTypeService.Search();
        DDLModel.DataTextField  = "Name";
        DDLModel.DataValueField = "Code";
        DDLModel.DataBind();

        if (!string.IsNullOrEmpty(Request["typeCode"]))
        {
            DDLModel.SelectedValue = Request["typeCode"];
        }

        int id = CommonClass.ReturnRequestInt("id", 0);

        if (id > 0)
        {
            TB_System_Dictionary model = SystemService.DictionaryService.Get(id);
            if (model != null)
            {
                DDLModel.SelectedValue = model.TypeCode.ToStr();
                TbName.Text            = model.Name;
                TbCode.Text            = model.Code;
                TbRemark.Text          = model.Remark;
                TbOrderBy.Text         = model.OrderBy.ToStr();
                ViewState["id"]        = model.ID;
            }
        }
    }
Пример #3
0
        public ActionResult Branch(int id)
        {
            DDLModel m = new DDLModel();

            m.Name    = "Branch";
            m.Caption = "- Select Branch -";
            m.Values  = CommonHelper.ToSelectItemList(new CommonHelper().GetBranch(id));
            return(PartialView("~/Views/Shared/_DDLView.cshtml", m));
        }
Пример #4
0
        public IActionResult BlocksDDL(int id)
        {
            DDLModel m = new DDLModel();

            m.PropertyToBind = "BlockId";
            m.GlyphIcon      = "glyphicon-map-marker";
            m.Items          = new PropertyAdvsHandler().GetNeighborhoods(new Neighborhood {
                Id = id
            }).ToSelectListItemList();
            return(PartialView("~/Views/Shared/_DDLView.cshtml", m));
        }
Пример #5
0
        public ActionResult Department(int id)
        {
            DDLModel m = new DDLModel();

            m.Name    = "Department";
            m.Caption = "- Select Department -";
            m.Values  = CommonHelper.ToSelectItemList(new CommonHelper().GetDepartment(new Branch {
                Id = id
            }));
            return(PartialView("~/Views/Shared/_DDLView.cshtml", m));
        }
Пример #6
0
        public ActionResult Cities(int id)
        {
            DDLModel model = new DDLModel();

            model.Name    = "City";
            model.Caption = "-Select Cities-";
            model.Values  = new LocationHandler().GetCities(new province {
                Id = id
            }).ToselectList();
            return(PartialView("~/Views/Shared/DDLlayout.cshtml", model));
        }
Пример #7
0
        public ActionResult Provinces(int id)
        {
            DDLModel model = new DDLModel();

            model.Caption = "-select province-";
            model.Name    = "Province";
            model.Values  = new LocationHandler().GetProvince(new Country {
                Id = id
            }).ToselectList();
            return(PartialView("~/Views/Shared/DDLlayout.cshtml", model));
        }
Пример #8
0
        public ActionResult Subcategories(int id)
        {
            DDLModel model = new DDLModel();

            model.Name     = "Subcategory";
            model.Caption  = "-Select SubCategory-";
            model.Glypicon = "glyphicon-tags";

            model.Values = new CategoryHandler().GetSubcategory(id).ToselectList();
            return(PartialView("~/Views/Shared/DDLlayout.cshtml", model));
        }
    //
    // GET: /Edmx/
    public ActionResult Index()
    {
        DDLModel model = new DDLModel();

        model.Items = new List <string>();

        using (var entities = new SampleEntities1())
        {
            model.Items = entities.GiveNames().ToList();
        }
        return(View(model));
    }
Пример #10
0
    //加载
    public void LoadDataBind()
    {
        DDLModel.DataSource     = SystemService.ExcelModelService.Search();
        DDLModel.DataTextField  = "ModelName";
        DDLModel.DataValueField = "ID";
        DDLModel.DataBind();

        int id = CommonClass.ReturnRequestInt("id", 0);

        if (id > 0)
        {
            TB_Excel_Fields model = SystemService.ExcelFieldsService.Get(id);
            if (model != null)
            {
                DDLModel.SelectedValue = model.ModelID.ToStr();
                TbFieldName.Text       = model.FieldName;
                TbChineseName.Text     = model.ChineseName;
                TbOrderBy.Text         = model.OrderBy.ToStr();
                CbExport.Checked       = model.Type.Contains("0") ? true : false;
                CbImport.Checked       = model.Type.Contains("1") ? true : false;
                ViewState["id"]        = model.ID;
            }
        }
    }