コード例 #1
0
        private void Create()
        {
            string obj            = Request["data"];
            string ProfessionType = Request["ProfessionType"];
            string MajorName      = Request["MajorName"];

            ent                = JsonHelper.GetObject <Expert>(obj);
            ent.MajorCode      = MajorName;
            ent.MajorName      = MajorName;
            ent.ProfessionType = ProfessionType;
            ent.CreateId       = WebPortalService.CurrentUserInfo.UserID;
            ent.CreateName     = WebPortalService.CurrentUserInfo.Name;
            ent.CreateTime     = DateTime.Now;
            ent.DoCreate();
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Aim.Portal.Web.WebPortalService.CheckLogon();
            }
            catch
            {
                Response.Write("<script> window.parent.location.href = '/Login.aspx';</script>");
                Response.End();
            }
            string action = Request["action"];

            Id = Request["Id"];
            if (!string.IsNullOrEmpty(action))
            {
                switch (action)
                {
                case "ProfessionType":
                    DoProfessionType();
                    break;

                case "MajorName":
                    sql = "select  * from  NCRL_Portal..SysEnumeration where ParentID = 'b640c40c-e2a9-41a8-bd28-d8ff9d71ff94' order by sortindex asc";
                    dt  = DataHelper.QueryDataTable(sql);
                    string str = JsonHelper.GetJsonString(dt);
                    if (!string.IsNullOrEmpty(Id))
                    {
                        ent = Expert.Find(Id);
                        Response.Write("{success:  true  ,MajorName:'" + ent.MajorName + "',rows:" + str + "}");
                        Response.End();
                        return;
                    }
                    Response.Write("{success:true,MajorName:'',rows:" + str + "}");
                    Response.End();
                    break;

                case "RCStore":
                    RCStore();
                    break;

                case "Create":
                    string obj            = Request["data"];
                    string ProfessionType = Request["ProfessionType"];
                    string MajorName      = Request["MajorName"];
                    ent                = JsonHelper.GetObject <Expert>(obj);
                    ent.MajorCode      = MajorName;
                    ent.MajorName      = MajorName;
                    ent.ProfessionType = ProfessionType;
                    sql                = "select max(SortIndex) from NCRL_SP..Expert";
                    ent.SortIndex      = DataHelper.QueryValue <int>(sql) + 1;
                    ent.DoCreate();
                    break;

                case "Update":
                    Update();
                    break;

                case "SelectEdit":
                    SelectEdit();
                    break;
                }
            }
        }