Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            int companyId = WX.Request.rCompanyId;
            int dutyId    = WX.Request.rDutyId;

            if (!IsPostBack)
            {
                WX.Model.Duty.MODEL model = WX.Request.rDuty; //WX.Model.Duty.GetModel("select * from [TE_Duties] where ID="+Request["id"]);
                if (dutyId == 0)
                {
                    this.DutyCatagory.Items.Add("无分类");
                }
                else
                {
                    WX.Data.Dict.BindListCtrl_DutyCatagory(DutyCatagory, null, null, model.DutyCatagoryID.ToString());
                }
                DutyNO.Text        = model.NO.value.ToString();
                DutyName.Text      = model.Name.value.ToString();
                FORM_CONTENT.Value = model.Description.ToString();
                //DutyCatagory.SelectedValue = model.DutyCatagoryID.ToString();
                //ddlGradeId.SelectedValue = model.GradeID.ToString();
                WX.Data.Dict.BindListCtrl_DutyGrade(ddlGradeId, null, null, model.GradeID.ToString());
                btnSave.Visible = dutyId != 0;
            }
        }
Exemple #2
0
        private void pageinit()
        {
            int id        = WX.Request.rDutyId;
            int companyId = WX.Request.rCompanyId;

            try
            {
                WX.Model.Duty.MODEL model = WX.Request.rDuty; //WX.Model.Duty.GetModel("select * from TE_Duties where ID="+id);
                if (!model.Menus.isEmpty && model.Menus.value.ToString() != "")
                {
                    ui_Htmls.Value = model.Menus.value.ToString();
                    return;
                }
            }
            catch
            {
                Response.Write("参数错误,你没有权限访问此功能!");
                Response.End();
                return;
            }

            //string menustr = WX.Main.CreateMenu(id);
            //if (menustr == "-1")
            //{
            //    Response.Write("参数错误或您没有权限,数据找不到!");
            //    Response.End();
            //    return;

            //}
            //ui_Htmls.Value = menustr;
        }
        protected void btnSave2_Click(object sender, EventArgs e)
        {
            DataTable dt = ULCode.QDA.XSql.GetDataTable("select ID from TE_Duties  where CompanyID=11");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string sSql = String.Format("if exists(Select * from TE_MenusInDuties where MenuId={0} and DutyId={1})"
                                            + " update TE_MenusInDuties set Flag={2} where MenuId={0} and DutyId={1}"
                                            + " else "
                                            + " insert into TE_MenusInDuties(MenuId,DutyId,Flag) values({0},{1},{2})", WX.Request.rMenuId, dt.Rows[i]["ID"], 1);
                ULCode.QDA.XSql.Execute(sSql);
                string menustr = new WX.Json.BuildUserMenus(Convert.ToInt32(dt.Rows[i]["ID"].ToString())).GetUserMenu();
                if (menustr != "-1")
                {
                    WX.Model.Duty.MODEL     model = WX.Model.Duty.NewDataModel(dt.Rows[i]["ID"]);
                    List <WX.Json.UserMenu> l_u   = WX.Json.JsonConvert.GetJsonObject <List <WX.Json.UserMenu> >(menustr, false);
                    if (l_u != null)
                    {
                        model.Menus.set(menustr);
                        if (model.Update() == 0)
                        {
                            model.RestoreInitial();
                        }
                    }
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     WX.Main.CurUser.LoadUserModel(true);
     WX.Model.DutyDetail.MODEL dutydetail = WX.Model.DutyDetail.GetModel(WX.Main.CurUser.UserModel.DutyId.ToInt32());
     WX.Model.Duty.MODEL       dutymodel  = WX.Model.Duty.GetModelToID(dutydetail.DutyID.ToInt32());
     Literal1.Text = dutymodel.Name.ToString();
     Literal2.Text = dutymodel.Description.ToString();
 }
        protected void Button2_Click(object sender, EventArgs e)
        {
            //1.验证用户权限
            //2.取得用户变量
            int companyId = WX.Request.rCompanyId;
            int Id        = WX.Request.rDutyId;

            WX.Model.Duty.MODEL model = WX.Request.rDuty;
            //4.业务处理过程
            bool bDeal = false;

            //填写主要业务逻辑代码
            if (true)
            {
                DropDownList cbox;
                //WX.Main.ExecuteDelete("TE_MenusInDuties", "DutyID", Id.ToString());
                for (int i = 0; i < Gv_duty.Rows.Count; i++)
                {
                    cbox = (DropDownList)Gv_duty.Rows[i].Cells[1].FindControl("ddlFlag");
                    if (cbox == null)
                    {
                        throw new ApplicationException("没有发现控件(ddlFlag)!");
                    }
                    string sSql = String.Format("if exists(Select * from TE_MenusInDuties where MenuId={0} and DutyId={1})"
                                                + " update TE_MenusInDuties set Flag={2} where MenuId={0} and DutyId={1}"
                                                + " else "
                                                + " insert into TE_MenusInDuties(MenuId,DutyId,Flag) values({0},{1},{2})", cbox.ToolTip, Id, cbox.SelectedValue);
                    ULCode.QDA.XSql.Execute(sSql);
                    //ULCode.QDA.XSql.Execute("insert into TE_MenusInDuties(MenuId,DutyId,Flag) values(" + cbox.ToolTip + "," + Id + "," + cbox.SelectedValue + ")");
                }
                bDeal = true;
            }
            else
            {
                model.RestoreInitial();
            }
            //5.(用户及业务对象)统计与状态
            if (bDeal)
            {
                WX.Main.CurUser.LoadDutyUser(true);
            }
            //6.登记日志
            if (bDeal)
            {
                WX.Main.AddLog(WX.LogType.Default, "编辑职务信息成功!", "");
            }

            //7.返回处理结果或返回其它页面。
            if (bDeal)
            {
                ULCode.Debug.Confirm(this, "已成功修改职务信息!是否返回职务列表页?", "Duty_List.aspx?CompanyID=" + companyId, this.Request.RawUrl);
            }
            else
            {
                ULCode.Debug.Alert(this, "编辑职务失败,请重试!");
            }
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            //1.验证用户权限
            //2.取得用户变量
            int companyId = WX.Request.rCompanyId;
            int Id        = WX.Request.rDutyId;

            WX.Model.Duty.MODEL model = WX.Request.rDuty;// WX.Model.Duty.GetModel("select * from [TE_Duties] where ID=" + Request["id"]);
            //WX.Model.Duty.MODEL model2 = WX.Model.Duty.GetModel("select * from TE_Duties where ID!=" + Request["id"] + " and ID=" + DutyID.Text.Trim());

            //以下代码由后台开发人员填写
            //3.验证用户变量,包含Request.QueryString及Request.Form
            //model.CompanyID.value = (Request["cmp"] != null && Request["cmp"] != "" ? Request["cmp"] : "11");
            //4.业务处理过程
            bool bDeal = false;

            //填写主要业务逻辑代码
            if (model.Update() != 0)
            {
                DropDownList cbox;
                WX.Main.ExecuteDelete("TE_FunctionsInDuties", "DutyID", dutyId.Text);
                for (int i = 0; i < Gv_duty.Rows.Count; i++)
                {
                    cbox = (DropDownList)Gv_duty.Rows[i].Cells[1].FindControl("ddlFlag");
                    if (cbox == null)
                    {
                        throw new ApplicationException("没有发现控件(ddlFlag)!");
                    }
                    ULCode.QDA.XSql.Execute("insert into TE_FunctionsInDuties values(" + cbox.ToolTip + "," + dutyId.Text.Trim() + "," + cbox.SelectedValue + ")");
                }
                bDeal = true;
            }
            else
            {
                model.RestoreInitial();
            }
            //5.(用户及业务对象)统计与状态
            if (bDeal)
            {
                WX.Main.CurUser.LoadDutyUser(true);
            }
            //6.登记日志
            if (bDeal)
            {
                WX.Main.AddLog(WX.LogType.Default, "编辑职务信息成功!", "");
            }

            //7.返回处理结果或返回其它页面。
            if (bDeal)
            {
                ULCode.Debug.Confirm(this, "已成功修改职务信息!是否返回职务列表页?", "Duty_List.aspx?CompanyID=11", this.Request.RawUrl);
            }
            else
            {
                ULCode.Debug.Alert(this, "编辑职务失败,请重试!");
            }
        }
Exemple #7
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            int companyId = WX.Request.rCompanyId;
            int Id        = WX.Request.rDutyId;
            //2.取得用户变量
            int    dutyNO = Convert.ToInt32(DutyNO.Text.Trim());
            string name   = DutyName.Text.Trim();

            WX.Model.Duty.MODEL model = WX.Request.rDuty;// WX.Model.Duty.GetModel("select * from [TE_Duties] where ID=" + Request["id"]);
            //WX.Model.Duty.MODEL model2 = WX.Model.Duty.GetModel("select * from TE_Duties where ID!=" + Request["id"] + " and ID=" + DutyID.Text.Trim());

            //以下代码由后台开发人员填写
            //3.验证用户变量,包含Request.QueryString及Request.Form
            if (dutyNO != Id && WX.Model.Duty.Caches.Find(delegate(WX.Model.Duty.MODEL dele) { return(dele.CompanyID.ToInt32() == companyId && dele.ID.ToInt32() == dutyNO); }) != null)
            {
                ULCode.Debug.AjaxAlert(this, "编辑职务失败,职务编号已存在!");
                return;
            }
            model.NO.set(dutyNO);
            model.Name.set(name);
            model.DutyCatagoryID.value = DutyCatagory.SelectedValue;
            model.GradeID.value        = ddlGradeId.SelectedValue;
            model.Description.value    = FORM_CONTENT.Value;
            //model.CompanyID.value = (Request["cmp"] != null && Request["cmp"] != "" ? Request["cmp"] : "11");
            //4.业务处理过程
            bool bDeal = false;

            //填写主要业务逻辑代码
            if (model.Update() != 0)
            {
                bDeal = true;
            }
            else
            {
                model.RestoreInitial();
            }
            //5.(用户及业务对象)统计与状态
            if (bDeal)
            {
                WX.Main.CurUser.LoadDutyUser(true);
            }
            //6.登记日志
            if (bDeal)
            {
                WX.Main.AddLog(WX.LogType.Default, "编辑职务信息成功!", "");
            }

            //7.返回处理结果或返回其它页面。
            if (bDeal)
            {
                ULCode.Debug.Confirm(this, "已成功修改职务信息!是否返回职务列表页?", "Duty_List.aspx?CompanyID=11", this.Request.RawUrl);
            }
            else
            {
                ULCode.Debug.Alert(this, "编辑职务失败,请重试!");
            }
        }
Exemple #8
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            //WX.Model.Duty.MODEL model = WX.Model.Duty.GetModel("select * from TE_Duties where ID=" + DutyID.Text.Trim());
            //1.验证用户权限

            //2.取得用户变量
            int companyId = WX.Request.rCompanyId;
            int dutyNo    = Convert.ToInt32(DutyNO.Text.Trim());

            //以下代码由后台开发人员填写
            //3.验证用户变量,包含Request.QueryString及Request.Form
            if (WX.Model.Duty.Caches.Find(delegate(WX.Model.Duty.MODEL dele) { return(dele.CompanyID.ToInt32() == companyId && dele.NO.ToInt32() == dutyNo); }) != null)
            {
                ULCode.Debug.AjaxAlert(this, "新增职务失败,职务编号已存在!");
                return;
            }
            WX.Model.Duty.MODEL model = WX.Model.Duty.NewDataModel();
            model.NO.value             = dutyNo;
            model.Name.value           = DutyName.Text.Trim();
            model.CompanyID.value      = companyId;
            model.DutyCatagoryID.value = DutyCatagory.SelectedValue;
            model.GradeID.value        = ddlGradeId.SelectedValue;
            model.Description.value    = FORM_CONTENT.Value;
            //4.业务处理过程
            bool bDeal = false;

            //填写主要业务逻辑代码
            if (model.Insert(true) > 0)
            {
                model.SaveIntoCaches();
                bDeal = true;
            }
            else
            {
                model = null;
            }
            //5.(用户及业务对象)统计与状态

            //6.登记日志
            if (bDeal)
            {
                WX.Main.AddLog(WX.LogType.Default, "添加职务信息成功!", "");
            }

            //7.返回处理结果或返回其它页面。
            if (bDeal)
            {
                ULCode.Debug.Confirm(this, "成功添加职务信息,是否继续添加?", this.Request.RawUrl, "Duty_List.aspx?CompanyID=" + companyId);
                //Response.Redirect("Duty_List.aspx?CompanyID=11");
            }
            else
            {
                ULCode.Debug.Alert("新增职务失败,请重试!");
            }
        }
Exemple #9
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            //1.验证用户权限

            //2.取得用户变量
            int    id        = WX.Request.rDutyId;
            int    companyId = WX.Request.rCompanyId;
            string menus     = this.ui_Htmls.Value;

            WX.Model.Duty.MODEL model = WX.Request.rDuty; //WX.Model.Duty.GetModel("select * from TE_Duties where ID="+id);
            //WX.Model.Duty.MODEL model = WX.Model.Duty.GetModel("select * from TE_Duties where ID=" + Request["id"]);

            //3.验证用户变量,包含Request.QueryString及Request.Form
            List <WX.Json.UserMenu> l_u = WX.Json.JsonConvert.GetJsonObject <List <WX.Json.UserMenu> >(menus, false);

            if (l_u == null)
            {
                ULCode.Debug.Alert(this, "你的文档不合法!保存失败!");
                return;
            }
            //4.业务处理过程
            bool bDeal = false;

            //填写主要业务逻辑代码
            model.Menus.set(ui_Htmls.Value);
            if (model.Update() != 0)
            {
                //WX.Main.CurUser.LoadDutyUser(true);
                bDeal = true;
            }
            else
            {
                model.RestoreInitial();
            }
            //5.(用户及业务对象)统计与状态

            //6.登记日志
            if (bDeal)
            {
                WX.Main.AddLog(WX.LogType.Default, "职务“" + model.Name.value.ToString() + "”生成菜单成功!", "");
            }

            //7.返回处理结果或返回其它页面。
            if (bDeal)
            {
                ULCode.Debug.Confirm(this, "成功生成职务菜单,是否返回职务列表页?", "/Manage/Sys/Duty_List.aspx?CompanyID=11", this.Request.RawUrl);
                //Response.Redirect();
            }
            else
            {
                ULCode.Debug.Alert(this, "生成失败,请重试!");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            int companyId = WX.Request.rCompanyId;
            int dutyId    = WX.Request.rDutyId;

            if (!IsPostBack)
            {
                WX.Model.Duty.MODEL model = WX.Request.rDuty;
                this.DutyId.Text   = model.ID.value.ToString();
                this.DutyName.Text = model.Name.value.ToString();

                string    sSql = "exec [dbo].[sp_get_tree_multi_table] 'TE_Menus','ID','Name','ParentID','OrderId',0,1,3";
                DataTable dt   = ULCode.QDA.XSql.GetDataTable(sSql);
                this.Gv_duty.RowDataBound += new GridViewRowEventHandler(WX.Ctrl.GridView_DynamicColor_RowDataBound);
                Gv_duty.DataSource         = dt;
                Gv_duty.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }

            int companyId = WX.Request.rCompanyId;
            int dutyId    = WX.Request.rDutyId;

            if (!IsPostBack)
            {
                WX.Model.Duty.MODEL model = WX.Request.rDuty; //WX.Model.Duty.GetModel("select * from [TE_Duties] where ID="+Request["id"]);
                this.dutyId.Text   = model.ID.value.ToString();
                this.dutyName.Text = model.Name.value.ToString();

                string    sSql = "exec [dbo].[sp_get_tree_multi_table] 'TE_Functions','ID','Name','ParentID','OrderId',0,1,3";
                DataTable dt   = ULCode.QDA.XSql.GetDataTable(sSql);
                Gv_duty.DataSource = dt;
                Gv_duty.DataBind();
            }
        }