Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                WX.Model.DutyDetail.MODEL dd = WX.Model.DutyDetail.GetModel("select * from TE_DutyDetail where Id=" + WX.Main.CurUser.UserModel.DutyId.ToString());
                System.Data.DataTable     dt2;
                if (Request["rtype"] == "3")//领导管理层
                {
                    dt2          = ULCode.QDA.XSql.GetDataTable("select pp.*,tu.RealName from PLAN_Plan  pp left join TU_Users tu on pp.UserID=tu.UserID where RangeType=1 and PlanState=1  order by RangeType desc");
                    MenuBar1.Key = "plan_cmp";
                }
                else//主管
                {
                    string ids  = ULCode.QDA.XSql.GetXDataTable("select ID  from TE_Departments where ParentID=" + WX.Main.CurUser.UserModel.DepartmentID.ToString()).ToColValueList(",", 0);
                    string ids2 = ULCode.QDA.XSql.GetXDataTable("select DepartentID  from TU_User_X_DutyDetail tu left join TE_DutyDetail te on te.ID=tu.DutyDetailID where tu.UserID='" + WX.Main.CurUser.UserID + "'").ToColValueList(",", 0);

                    dt2 = ULCode.QDA.XSql.GetDataTable("select pp.*,tu.RealName from PLAN_Plan  pp left join TU_Users tu on pp.UserID=tu.UserID where RangeType=1 and PlanState=1 and tu.DepartmentID  in(" + WX.Main.CurUser.UserModel.DepartmentID.ToString() + (ids != "" ? "," + ids : "") + (ids2 != "" ? "," + ids2 : "") + ") order by RangeType desc");
                }
                Gv_duty.DataSource = dt2;
                Gv_duty.DataBind();
                if (Gv_duty.Rows.Count > 0)
                {
                    Gv_duty.HeaderRow.TableSection = TableRowSection.TableHeader;
                    Gv_duty.HeaderStyle.Height     = Unit.Pixel(40);
                }
            }
        }
        private void BindTask()
        {
            string sql = "select * from PLAN_Task where PlanID=" + WX.Request.rPlanId + " order by id";

            System.Data.DataTable dt = ULCode.QDA.XSql.GetDataTable(sql);
            Gv_duty.DataSource = dt;
            Gv_duty.DataBind();
        }
Ejemplo n.º 3
0
        private void BindTask()
        {
            string sql = "select * from PLAN_Task where State=1 and PlanID=" + WX.Request.rPlanId + " order by Statetime";

            System.Data.DataTable dt = ULCode.QDA.XSql.GetDataTable(sql);
            Gv_duty.DataSource = dt;
            Gv_duty.DataBind();
            int    iCount = 4;
            int    iAll   = 10;
            String r      = String.Format("完成{0}个,总计{1}个", iCount, iAll);
        }
Ejemplo n.º 4
0
        private void gridviewBind(WX.Model.Plan.MODEL plan)
        {
            lititle.Text        = plan.Title.ToString();
            lititle.NavigateUrl = "#";
            imgwidth            = (Convert.ToDouble(plan.Current.ToString()) / Convert.ToDouble(plan.Total.ToString())) * 100;
            lijindu.Text        = " 进度:" + imgwidth.ToString("f0") + "%";
            licontent.Text      = plan.Content.ToString().Replace("\n", "<br/>");
            System.Data.DataTable dtApp = WX.Model.Appraise.GetList(plan.id.ToInt32());
            Apptable.Text = "";
            for (int i = 0; i < dtApp.Rows.Count; i++)
            {
                Apptable.Text += "<li><a title=\"" + dtApp.Rows[i]["Content"] + "\">" + WX.CommonUtils.GetRealNameListByUserIdList(dtApp.Rows[i]["UserID"].ToString()) + ":" + dtApp.Rows[i]["Content"] + "&nbsp;</a><img src=\"/images/Appraise" + dtApp.Rows[i]["Appraise"] + ".jpg\" /><span>" + Convert.ToDateTime(dtApp.Rows[i]["AddTime"]).ToString("yyyy-MM-dd") + "</span></li>";
            }
            string now = DateTime.Now.ToString("yyyy-MM-dd");

            WX.Main.CurUser.LoadDutyDetailUser();
            if (plan.PlanState.ToInt32() == -1 && plan.UserID.ToString() == WX.Main.CurUser.UserID)
            {
                liPlanState.Text = "<b style='color:red;'>审核未通过</b>。原因:" + plan.Reason.ToString() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<请重新编辑然后提交><br/>";
            }
            //if (plan.Type.ToString() == "2")
            liSummary.Text = plan.Summary.ToString() == "" ? (DateTime.Now >= plan.Stoptime.ToDateTime().AddDays(-2) && plan.UserID.ToString() == WX.Main.CurUser.UserID ? "<b>总结:</b><a href='Plan_EditSummary.aspx?PlanId=" + plan.id.ToString() + "' style='color:blue;'>创建总结</a>" : "") : "<b>总结:</b>" + plan.Summary.ToString() + (plan.Appraise.ToString() == "" && plan.UserID.ToString() == WX.Main.CurUser.UserID ? "<a href='Plan_EditSummary.aspx?PlanId=" + plan.id.ToString() + "' style='color:blue;'>编辑</a>" : "");
            //else if (plan.Type.ToString() == "3")
            //  liSummary.Text = plan.Summary.ToString() == "" ? (DateTime.Now >= plan.Stoptime.ToDateTime().AddDays(-2) && plan.UserID.ToString() == WX.Main.CurUser.UserID ? "<b>总结:</b><a href='Plan_EditSummary.aspx?PlanId=" + plan.id.ToString() + "' style='color:blue;'>创建总结</a>" : "") : "<b>总结:</b>" + plan.Summary.ToString() + (plan.Appraise.ToString() == "" && plan.UserID.ToString() == WX.Main.CurUser.UserID ? "<a href='Plan_EditSummary.aspx?PlanId=" + plan.id.ToString() + "' style='color:blue;'>编辑</a>" : "");
            liAppraise.Text = plan.Appraise.ToString() == "" ?
                              (!plan.Summary.isEmpty && WX.Main.CurUser.DutyDetailUser.DutyCatagoryID.ToInt32() == 1
                           ? "<br/><b>评价:</b><a href='Plan_EditAppraise.aspx?PlanId=" + plan.id.ToString() + "' style='color:blue;'>现在点评</a>"
                             : "")
                    : "<br/><b>评价:</b>" + plan.Appraise.ToString();
            string wherestr = " where PlanID=" + plan.id.ToString();

            System.Data.DataTable dt = ULCode.QDA.XSql.GetDataTable("select * from PLAN_Task" + wherestr + " order by id");
            Gv_duty.DataSource = dt;
            Gv_duty.DataBind();
            if (Request["estate"] != null)
            {
                Gv_duty.Columns[2].Visible = true;
            }
            if (plan.Type.ToInt32() < 3)
            {
                divjd.Visible = false;
            }
            if (plan.PlanState.ToInt32() < 2)
            {
                Gv_duty.Columns[2].Visible = false;
            }
        }
Ejemplo n.º 5
0
        private void FillData()
        {
            this.DT_Duties = ULCode.QDA.XSql.GetDataTable("select ID,Name,DutyCatagoryID from te_duties ");
            //添加职务分类行
            DataTable dtC = WX.Data.Dict.GetDataTable_DutyCatagory();

            foreach (DataRow dr in dtC.Rows)
            {
                BoundField bf = new BoundField();
                bf.HeaderText = Convert.ToString(dr["Name"]);
                bf.DataField  = "DC" + Convert.ToString(dr["ID"]);
                Gv_duty.Columns.Add(bf);
            }
            //添加部门列
            System.Data.DataTable dtR = WX.Model.DutyDetail.GetDeptList();
            Gv_duty.DataSource = dtR;
            Gv_duty.DataBind();
            Gv_duty.HeaderRow.TableSection = TableRowSection.TableHeader;
            Gv_duty.HeaderStyle.Height     = Unit.Pixel(40);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         WX.Model.Plan.MODEL plan = WX.Request.rPlan;
         lititle.Text     = plan.Title.ToString();
         lirealname.Text  = WX.CommonUtils.GetRealNameListByUserIdList(plan.UserID.ToString());
         licurr.Text      = plan.Current.ToString();
         litotal.Text     = plan.Total.ToString();
         licontent.Text   = plan.Content.ToString();
         litype.Text      = plan.Type.ToString() == "3" ? "月计划" : (plan.Type.ToString() == "2" ? "周计划" : "日计划");
         liStarttime.Text = plan.Starttime.ToDateTime().ToString("yyyy-MM-dd");
         liStoptime.Text  = plan.Stoptime.ToDateTime().ToString("yyyy-MM-dd");
         lisummary.Text   = plan.Summary.ToString();
         string wherestr          = " where PlanID=" + plan.id.ToString();
         System.Data.DataTable dt = ULCode.QDA.XSql.GetDataTable("select * from PLAN_Task" + wherestr + " order by id");
         Gv_duty.DataSource = dt;
         Gv_duty.DataBind();
     }
 }
Ejemplo n.º 7
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;
                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();
            }
        }
Ejemplo n.º 8
0
 public void gridviewBind()
 {
     if (Request["PlanId"] == null || Request["PlanId"] == "")
     {
         Response.Write("<br/><center><b>任务不存在,请创建!</b></center><br/>");
         div1.Visible = false;
     }
     else
     {
         string    wherestr = " where PlanID=" + WX.Request.rPlanId;
         DataTable dt       = ULCode.QDA.XSql.GetDataTable("select * from PLAN_Task" + wherestr + " order by id");
         Gv_duty.DataSource = dt;
         Gv_duty.DataBind();
         if (Request["methed"] == null)
         {
             Gv_duty.Columns[3].Visible = false;
             div1.Visible = false;
         }
         if (Request["estate"] == null)
         {
             Gv_duty.Columns[2].Visible = false;
         }
     }
 }
Ejemplo n.º 9
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"]);
                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();
            }
        }
Ejemplo n.º 10
0
        public void gridviewBind()
        {
            try
            {
                companyid = int.Parse(Request["CompanyID"]);
            }
            catch
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            string    wherestr = " where CompanyID=" + companyid;
            DataTable dt       = ULCode.QDA.XSql.GetDataTable("select TE_Duties.*,TE_DutyCatagory.Name as DutyCatagoryName,TE_DutyCatagory.Sort as DutyCatagoryNo,HR_Grade.Name as GradeName from TE_Duties "
                                                              + " left join TE_DutyCatagory on TE_Duties.[DutyCatagoryID]=TE_DutyCatagory.ID "
                                                              + " left join HR_Grade on HR_Grade.Sort=TE_Duties.GradeID"
                                                              + wherestr + " order by DutyCatagoryNo desc,GradeID");

            Gv_duty.DataSource         = dt;
            this.Gv_duty.RowDataBound += new GridViewRowEventHandler(WX.Ctrl.GridView_DynamicColor_RowDataBound);
            Gv_duty.DataBind();
            Gv_duty.HeaderRow.TableSection = TableRowSection.TableHeader;
            Gv_duty.HeaderStyle.Height     = Unit.Pixel(40);
        }