示例#1
0
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Cells[1].Text = e.Row.Cells[1].Text == "True" ? "男" : "女";
                switch (e.Row.Cells[7].Text)
                {
                case "2": e.Row.Cells[7].Text = "未通过&nbsp;&nbsp;<a href='?UserID=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "&redo=1&state=5'>重新面试</a>"; break;

                case "5": e.Row.Cells[7].Text = "等待审核"; break;

                case "6": e.Row.Cells[7].Text = "<a href='HR_AddIntojobs.aspx?UserId=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>审核并入职</a>"; break;

                case "10": e.Row.Cells[7].Text = "<a href='HR_AddIntojobs.aspx?UserId=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>员工档案</a><a href='HR_AddTransferKong.aspx?type=1&UserId=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>调岗</a><a href='HR_Official.aspx?UserID=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>转正</a><a href='HR_Leavejobs2.aspx?UserID=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>离职</a>"; break;

                case "20":
                {
                    e.Row.Cells[7].Text = "<a href='HR_AddTransferKong.aspx?type=1&UserId=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>调岗</a><a href='HR_AddTransferKong.aspx?type=2&UserID=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>升职</a><a href='HR_Userjobs.aspx?UserId=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>加/撤职</a><a href='HR_Leavejobs2.aspx?UserID=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>离职</a>";
                    ULCode.QDA.XDataTable xdt = ULCode.QDA.XSql.GetXDataTable("select te.Name from TU_User_X_DutyDetail tuxd left join TE_DutyDetail te on tuxd.DutyDetailID=te.ID where tuxd.UserID='" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'");
                    string str = xdt.ToColValueList(",+", 0);
                    if (str != "")
                    {
                        e.Row.Cells[5].Text += ",+" + str;
                    }
                    break;
                }

                //case "30": e.Row.Cells[7].Text = "<a href='HR_AddTransferKong.aspx?type=1&uid=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>调岗</a>&nbsp;&nbsp;<a href='HR_AddTransferKong.aspx?type=2&uid=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>升职</a>&nbsp;&nbsp;<a href='HR_Leavejobs.aspx?uid=" + Gv_intojobs.DataKeys[e.Row.RowIndex].Value + "'>离职</a>"; break;
                case "40": e.Row.Cells[7].Text = "离职中。。。"; break;

                default: break;
                }
            }
        }
 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         ULCode.QDA.XDataTable xdt = ULCode.QDA.XSql.GetXDataTable("select pu.UserID,te.RealName from PRO_User pu left join TU_Users te on pu.UserID=te.UserID where pu.type=1 and pid=" + e.Row.Cells[4].Text);
         e.Row.Cells[4].Text = xdt.ToColValueList(",", 1);
     }
 }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         WX.PRO.Project.MODEL model = WX.PRO.Project.GetModel("select * from PRO_Projects where ID=" + WX.Request.rProjectId);
         if (model != null)
         {
             li_name.Text = model.ProjectName.ToString();
             ui_Name.Text = model.ProjectName.ToString();
             li_days.Text = model.Days.ToString();
             ui_days.Text = model.Days.ToString();
             if (Convert.ToInt32(model.Persons.ToString()) > 0)
             {
                 ULCode.QDA.XDataTable xdt = ULCode.QDA.XSql.GetXDataTable("select pu.UserID,te.RealName from PRO_User pu left join TU_Users te on pu.UserID=te.UserID where pu.type=1 and pid=" + model.ID.ToString());
                 li_persons.Text  = xdt.ToColValueList(",", 1);
                 ui_Persons.Value = xdt.ToColValueList(",", 0);
                 liu_Persons.Text = xdt.ToColValueList(",", 1);
             }
             li_fee.Text     = model.Fee.ToString();
             ui_fee.Text     = model.Fee.ToString();
             li_content.Text = model.Content.ToString();
             li_Imagine.Text = model.Imagine.ToString();
             li_state.Text   = WX.PRO.Project.statearray[Convert.ToInt32(model.State.ToString())];
             if (model.Annex.ToString() != "")
             {
                 li_annex.Text = "<a href='" + model.Annex.ToString() + "'>" + model.Annex.ToString() + "</a>";
             }
             if (model.State.ToString() == "1" || model.State.ToString() == "0")
             {
                 tr1.Visible       = false;
                 tr2.Visible       = false;
                 checkdata.Visible = model.State.ToString() != "0";
             }
             else
             {
                 WX.PRO.State.MODEL statemodel = WX.PRO.State.GetModel("select * from PRO_State where ProjID=" + model.ID.ToString());
                 if (statemodel.ProcID.ToString() != "" && statemodel.ProcID.ToString() != "0")
                 {
                     //WX.PRO.Process.MODEL procmodel = WX.PRO.Process.GetModel("select top 1 * from PRO_Process where ProjID=" + statemodel.ProjID.ToString() + " and NO="+statemodel.ProcID.ToString());
                     hivalue = statemodel.ProcID.ToString();
                 }
                 li_projmanage.Text   = WX.CommonUtils.GetRealNameListByUserIdList(statemodel.Manage.ToString());
                 li_checkfee.Text     = statemodel.Fee.ToString();
                 li_checkmanage.Text  = WX.CommonUtils.GetRealNameListByUserIdList(model.Manage.ToString());
                 li_checkopinion.Text = model.Opinion.ToString();
                 li_checktime.Text    = Convert.ToDateTime(model.Stime.value).ToString("yyyy-MM-dd HH:mm:ss");
                 checkdata.Visible    = false;
             }
         }
         ReBind();
     }
 }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //1.验证当前用户页面权限
     if (!this.Master.A_Edit)
     {
         Response.Write("你没有权限访问此功能!");
         Response.End();
         return;
     }
     if (!IsPostBack)
     {
         if (Request["id"] != null)
         {
             WX.PRO.Project.MODEL model = WX.PRO.Project.GetModel("select * from PRO_Projects where ID=" + Request["id"]);
             if (model != null)
             {
                 ui_Name.Text = model.ProjectName.ToString();
                 ui_days.Text = model.Days.ToString();
                 if (Convert.ToInt32(model.Persons.ToString()) > 0)
                 {
                     ULCode.QDA.XDataTable xdt = ULCode.QDA.XSql.GetXDataTable("select pu.UserID,te.RealName from PRO_User pu left join TU_Users te on pu.UserID=te.UserID where pu.type=1 and pid=" + model.ID.ToString());
                     ui_Persons.Value = xdt.ToColValueList(",", 0);
                     li_Persons.Text  = xdt.ToColValueList(",", 1);
                 }
                 //ui_Persons.Value = model.Persons.ToString();
                 ui_fee.Text      = model.Fee.ToString();
                 ui_content.Value = model.Content.ToString();
                 ui_Imagine.Text  = model.Imagine.ToString();
                 if (model.Annex.ToString() != "")
                 {
                     li_annex.Text = "<a href='" + model.Annex.ToString() + "'>" + model.Annex.ToString() + "</a> <br/>";
                 }
                 if (ULCode.QDA.XSql.GetDataTable("select ID from PRO_Process where ProjID=" + model.ID.ToString()).Rows.Count > 0)
                 {
                     Button2.Visible = true;
                 }
             }
         }
     }
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            WX.HR.DutyLog.MODEL log = WX.HR.DutyLog.NewDataModel();
            string userId           = WX.Request.rUserId;

            WX.HR.TransferKong.MODEL tfk       = WX.HR.TransferKong.NewDataModel();
            WX.Model.User.MODEL      usermodel = WX.Request.rUser;
            tfk.Addtime.value     = DateTime.Now;
            tfk.UserID.value      = userId;
            tfk.BackDutyID.value  = ui_duty.SelectedValue;
            tfk.BackDempID.value  = ui_demp.SelectedValue;
            tfk.NowDutyID.value   = ui_duty2.SelectedValue;
            tfk.NowDempID.value   = ui_demp2.SelectedValue;
            tfk.BackGrade.value   = DropDownList1.SelectedValue;
            tfk.NowGrade.value    = DropDownList2.SelectedValue;
            tfk.dempOpinion.value = ui_dempop.Text;
            tfk.dempManager.value = ui_dempuser.Value;
            tfk.hrOpinion.value   = ui_hrop.Text;
            tfk.hrManager.value   = ui_hruser.Value;
            tfk.bossOpinion.value = ui_bossop.Text;
            tfk.bossManager.value = ui_bossuser.Value;
            tfk.type.value        = Request["type"] == "1" ? 1 : 2;
            int tfkid = tfk.Insert(true);

            log.Content.value = "员工" + (tfk.type.ToString() == "1" ? "调岗" : "升职");
            WX.Model.DutyDetail.MODEL dutydetail = WX.Model.DutyDetail.GetModel(Convert.ToInt32(ui_duty2.SelectedValue));
            usermodel.Grade.value        = dutydetail.GradeID.value;
            usermodel.DepartmentID.value = ui_demp2.SelectedValue;
            usermodel.DutyId.value       = ui_duty2.SelectedValue;
            usermodel.Grade.value        = DropDownList2.SelectedValue;
            usermodel.Update();
            WX.Model.DutyDetail.MODEL dutydetailback = WX.Model.DutyDetail.GetModel(Convert.ToInt32(ui_duty.SelectedValue));
            ULCode.QDA.XDataTable     xdt            = ULCode.QDA.XSql.GetXDataTable("select RealName from TU_Users  where DutyId=" + dutydetailback.ID.ToString() + " and State>6 and State<40");
            dutydetailback.UsersName.value = xdt.ToColValueList(",", 0);
            if (dutydetailback.UsersName.ToString() != "")
            {
                dutydetailback.Update();
            }
            xdt = ULCode.QDA.XSql.GetXDataTable("select RealName from TU_Users  where DutyId=" + dutydetail.ID.ToString() + " and State>6 and State<40");
            dutydetail.UsersName.value = xdt.ToColValueList(",", 0);
            if (dutydetail.UsersName.ToString() != "")
            {
                ULCode.QDA.XSql.Execute("update TE_DutyDetail set UsersName=replace(UsersName,'" + usermodel.RealName.ToString() + ",','')");
                dutydetail.UsersName.value = dutydetail.UsersName.ToString() + ",";
                dutydetail.Update();
            }
            //日志
            log.UserID.value      = userId;
            log.BackDutyID.value  = ui_duty.SelectedValue;
            log.BackDempID.value  = ui_demp.SelectedValue;
            log.NowDutyID.value   = ui_duty2.SelectedValue;
            log.NowDempID.value   = ui_demp2.SelectedValue;
            log.Backtableid.value = tfk.type.ToString() == "1" ? 2 : 3;
            log.Backcolumid.value = tfkid;
            log.Starttime.value   = DateTime.Now;
            log.GradeID.value     = usermodel.Grade.value;
            WX.HR.DutyLog.MODEL backlog = WX.HR.DutyLog.GetModel("select top 1 * from HR_DutyLogs where UserID='" + userId + "' order by Starttime desc");
            if (backlog != null)
            {
                backlog.stoptime.value   = DateTime.Now;
                backlog.Nowtableid.value = tfk.type.ToString() == "1" ? 2 : 3;
                backlog.Nowcolumid.value = tfkid;
                backlog.Update();
            }
            log.Insert();
            Response.Redirect("HR_Intojobs.aspx?state=20");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            WX.Main.CurUser.LoadDutyDetailUser();
            string    sql = "select cc.ID,ContactName,BabySex,cc.CustomerID,CustomerName from CRM_Contact cc inner join CRM_Customers ccu on cc.CustomerID=ccu.ID left join Tu_Users tu on ccu.EmployeeID=tu.UserID where datediff(day,BabyBirthday,getdate())=0 and (BabySex='男' or BabySex='女')" + (WX.Main.CurUser.DutyDetailUser.DutyID.ToInt32() >= 900 ? "" : " and tu.DepartmentID=" + WX.Main.CurUser.UserModel.DepartmentID.ToString());
            DataTable dt  = ULCode.QDA.XSql.GetDataTable(sql);
            int       no  = 1;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                tablestr += "<tr><th style=\"width: 30px;\"></th><td> " + no + "、" + dt.Rows[i]["CustomerName"] + dt.Rows[i]["ContactName"] + (dt.Rows[i]["BabySex"].ToString() == "男" ? "儿子" : "女儿") + "今天生日!</td><td class=\"manage\" style=\"width: 100px;\"><a href=\"Crm_Single_AddContact.aspx?PageMode=my&Action=Edit&&ContactID=" + dt.Rows[i]["ID"] + "&CustomerID=" + dt.Rows[i]["CustomerID"] + "\">维护</a></td></tr>";
                no++;
            }
            sql = "select ct.ID,ct.ProcessState,cc.CustomerID CustomerNo,cc.CustomerName from CRM_Track ct left join CRM_Customers cc on ct.CustomerID=cc.ID  left join Tu_Users tu on cc.EmployeeID=tu.UserID where datediff(day,TrackTime,getdate())=0 and ct.State=0" + (WX.Main.CurUser.DutyDetailUser.DutyID.ToInt32() >= 900 ? "" : " and tu.DepartmentID=" + WX.Main.CurUser.UserModel.DepartmentID.ToString());
            DataTable dt2 = ULCode.QDA.XSql.GetDataTable(sql);

            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                tablestr += "<tr><th style=\"width: 30px;\"></th><td> " + no + "、" + dt2.Rows[i]["CustomerName"] + "今日应该" + WX.CRM.Track.ProcessState[Convert.ToInt32(dt2.Rows[i]["ProcessState"])] + "!</td><td class=\"manage\" style=\"width: 100px;\"><a href=\"javascript:PopupIFrame('CRM_SingleM_EditTrack.aspx?TrackID=" + dt2.Rows[i]["ID"] + "','提交跟踪信息','','',700,450)\">维护</a></td></tr>";
                no++;
            }
            string ids = WX.Main.GetUserDeptids(WX.Main.CurUser.UserID);

            WX.Main.CurUser.LoadMyDepartment();
            DataTable dtcount = ULCode.QDA.XSql.GetDataTable("exec " + (WX.CommonUtils.GetBossUserID == WX.Main.CurUser.UserID || WX.Main.CurUser.MyDepartMent.ID.ToString() == System.Configuration.ConfigurationManager.AppSettings["Dept_CA"] ? "Get_CRM_ManagerLDTongji" : "Get_CRM_ManagerTongji2 '" + (ids != "" ? ids : WX.Main.CurUser.UserModel.DepartmentID.ToString()) + "'"));

            limycount.Text     = dtcount.Rows[0]["mycount"].ToString();
            limyTempcount.Text = dtcount.Rows[0]["myTempcount"].ToString();
            sql = "SELECT  case CustomerZJM when '' then CustomerName else CustomerZJM end CustomerName FROM CRM_CustomersTemp C left join TU_Users tu on C.EmployeeID=tu.UserID where C.State>-1" + (WX.Main.CurUser.DutyDetailUser.DutyID.ToInt32() >= 900 ? "" : " and tu.DepartmentID=" + WX.Main.CurUser.UserModel.DepartmentID.ToString())
                  + " union all "
                  + " SELECT  case CustomerZJM when '' then CustomerName else CustomerZJM end CustomerName FROM CRM_ContactTemp as cctemp left join CRM_Customers AS C  on cctemp.CustomerID=C.ID left join TU_Users tu on C.EmployeeID=tu.UserID"
                  + " where cctemp.CheckState>-1" + (WX.Main.CurUser.UserID == WX.CommonUtils.GetBossUserID ? "" : " and tu.DepartmentID=" + WX.Main.CurUser.UserModel.DepartmentID.ToString());
            ULCode.QDA.XDataTable tempdt = ULCode.QDA.XSql.GetXDataTable(sql);
            Literal1.Text = tempdt.ToColValueList(",", 0);
            Literal3.Text = dtcount.Rows[0]["myGTcount"].ToString();
            DataTable gtdt = ULCode.QDA.XSql.GetDataTable("select top 10 case CustomerZJM when '' then CustomerName else CustomerZJM end CustomerName,cc.ID from CRM_Customers cc" + (WX.Main.CurUser.UserID != WX.CommonUtils.GetBossUserID ? " left join Tu_Users tu on cc.EmployeeID=tu.UserID where cc.State>0 and tu.DepartmentID in(" + (ids != "" ? ids : WX.Main.CurUser.UserModel.DepartmentID.ToString()) + ") and StageID<2" : " where cc.State>0 and StageID<2 "));

            //Literal4.Text = gtdt.ToColValueList(",", 0);
            Literal4.Text = this.GetCustomerNames(gtdt);
            Literal6.Text = dtcount.Rows[0]["myGZcount"].ToString();
            DataTable gzdt = ULCode.QDA.XSql.GetDataTable("select top 10 case CustomerZJM when '' then CustomerName else CustomerZJM end CustomerName,cc.ID from CRM_Customers cc" + (WX.Main.CurUser.UserID != WX.CommonUtils.GetBossUserID ? " left join Tu_Users tu on cc.EmployeeID=tu.UserID where cc.State>0 and tu.DepartmentID in(" + (ids != "" ? ids : WX.Main.CurUser.UserModel.DepartmentID.ToString()) + ") and StageID=2" : " where cc.State>0 and StageID=2 "));

            Literal7.Text = this.GetCustomerNames(gzdt);
            Literal9.Text = dtcount.Rows[0]["myQYcount"].ToString();
            DataTable qydt = ULCode.QDA.XSql.GetDataTable("select top 10 case CustomerZJM when '' then CustomerName else CustomerZJM end CustomerName,cc.ID from CRM_Customers cc" + (WX.Main.CurUser.UserID != WX.CommonUtils.GetBossUserID ? " left join Tu_Users tu on cc.EmployeeID=tu.UserID where cc.State>0 and tu.DepartmentID in(" + (ids != "" ? ids : WX.Main.CurUser.UserModel.DepartmentID.ToString()) + ") and StageID=3" : " where cc.State>0 and StageID=3 "));

            Literal10.Text = this.GetCustomerNames(qydt);
            Literal12.Text = dtcount.Rows[0]["myWHcount"].ToString();
            DataTable whdt = ULCode.QDA.XSql.GetDataTable("select top 10 case CustomerZJM when '' then CustomerName else CustomerZJM end CustomerName,cc.ID from CRM_Customers cc" + (WX.Main.CurUser.UserID != WX.CommonUtils.GetBossUserID ? " left join Tu_Users tu on cc.EmployeeID=tu.UserID where cc.State>0 and  tu.DepartmentID in(" + (ids != "" ? ids : WX.Main.CurUser.UserModel.DepartmentID.ToString()) + ") and StageID=4" : " where cc.State>0 and StageID=4 "));

            Literal13.Text = this.GetCustomerNames(whdt);
            Literal15.Text = dtcount.Rows[0]["cmpmonthcount"].ToString();
            Literal16.Text = dtcount.Rows[0]["deptmonthcount"].ToString();
            Literal18.Text = dtcount.Rows[0]["cmpmonthQYcount"].ToString();
            Literal19.Text = dtcount.Rows[0]["deptmonthQYcount"].ToString();
            Literal21.Text = dtcount.Rows[0]["cmpmonthGZcount"].ToString();
            Literal22.Text = dtcount.Rows[0]["deptmonthGZcount"].ToString();
            Literal24.Text = dtcount.Rows[0]["cmpmonthTrackcount"].ToString();
            Literal25.Text = dtcount.Rows[0]["deptmonthTrackcount"].ToString();
            Literal27.Text = string.Format("{0:C2}", dtcount.Rows[0]["cmpmonthTrackfee"]);
            Literal28.Text = string.Format("{0:C2}", dtcount.Rows[0]["deptmonthTrackfee"]);


            Literal30.Text = dtcount.Rows[0]["cmpyearcount"].ToString();
            Literal35.Text = dtcount.Rows[0]["deptyearcount"].ToString();
            Literal31.Text = dtcount.Rows[0]["cmpyearQYcount"].ToString();
            Literal36.Text = dtcount.Rows[0]["deptyearQYcount"].ToString();
            Literal32.Text = dtcount.Rows[0]["cmpyearGZcount"].ToString();
            Literal37.Text = dtcount.Rows[0]["deptyearGZcount"].ToString();
            Literal33.Text = dtcount.Rows[0]["cmpyearTrackcount"].ToString();
            Literal38.Text = dtcount.Rows[0]["deptyearTrackcount"].ToString();
            Literal34.Text = string.Format("{0:C2}", dtcount.Rows[0]["cmpyearTrackfee"]);
            Literal39.Text = string.Format("{0:C2}", dtcount.Rows[0]["deptyearTrackfee"]);
            if (WX.Main.CurUser.DutyDetailUser.DutyID.ToInt32() >= 900)
            {
                monthdiv.Visible = false;
                yeardiv.Visible  = false;
            }
            DataTable categorydt = ULCode.QDA.XSql.GetDataTable("select CategoryID,count(CategoryID) count,max(CategoryName) cname  from CRM_Customers cc left join CRM_InnerCategory cic on cc.CategoryID=cic.ID where EmployeeID='" + WX.Main.CurUser.UserID + "' and CategoryID is not null group by CategoryID ");

            for (int i = 0; i < categorydt.Rows.Count; i++)
            {
                Literal45.Text += (i > 0 ? "," : "") + categorydt.Rows[i]["cname"] + categorydt.Rows[i]["count"] + "个";
            }
            DataTable Naturedt = ULCode.QDA.XSql.GetDataTable("select NatureID,count(NatureID) count,max(CompanyNature) cname  from CRM_Customers cc left join CRM_CompanyNature cin on cc.NatureID=cin.ID where EmployeeID='" + WX.Main.CurUser.UserID + "' and NatureID is not null group by NatureID");

            for (int i = 0; i < Naturedt.Rows.Count; i++)
            {
                Literal46.Text += (i > 0 ? "," : "") + Naturedt.Rows[i]["cname"] + Naturedt.Rows[i]["count"] + "个";
            }
            DataTable Sourcedt = ULCode.QDA.XSql.GetDataTable("select SourceID,count(SourceID) count,max(SourceName) cname  from CRM_Customers cc left join CRM_Source cs on cc.SourceID=cs.ID where EmployeeID='" + WX.Main.CurUser.UserID + "' and SourceID is not null group by SourceID ");

            for (int i = 0; i < Sourcedt.Rows.Count; i++)
            {
                Literal47.Text += (i > 0 ? "," : "") + Sourcedt.Rows[i]["cname"] + Sourcedt.Rows[i]["count"] + "个";
            }
            DataTable Industrydt = ULCode.QDA.XSql.GetDataTable("select IndustryID,count(IndustryID) count,max(IndustryName) cname  from CRM_Customers cc left join CRM_Industry ci on cc.IndustryID=ci.ID where EmployeeID='" + WX.Main.CurUser.UserID + "' and IndustryID is not null group by IndustryID");

            for (int i = 0; i < Industrydt.Rows.Count; i++)
            {
                Literal48.Text += (i > 0 ? "," : "") + Industrydt.Rows[i]["cname"] + Industrydt.Rows[i]["count"] + "个";
            }
        }
示例#7
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //1.validate user data
            string userId = WX.Request.rUserId;

            //2.入职手续
            WX.HR.IntoJob.MODEL intojob = WX.HR.IntoJob.NewDataModel();
            intojob.UserID.value  = userId;
            intojob.Addtime.value = DateTime.Now;
            try
            {
                intojob.Addtime.value = ui_addtime.Text.Trim();
            }
            catch { }
            intojob.jobsname.value    = ui_jobname.SelectedValue;
            intojob.deptid.value      = ddlDepartment.SelectedValue;
            intojob.salary.value      = DropDownList1.SelectedValue;
            intojob.PSalary.value     = DropDownList2.SelectedValue;
            intojob.dempOpinion.value = ui_content.Text + "(" + DateTime.Now + ")";
            //intojob.GradeID.value = ui_grade.SelectedValue;
            intojob.SignUserID.value = WX.Main.CurUser.UserID;
            int jobid = intojob.Insert(true);

            WX.Model.User.MODEL       usermodel  = WX.Request.rUser;
            WX.Model.DutyDetail.MODEL dutydetail = WX.Model.DutyDetail.GetModel(Convert.ToInt32(ui_jobname.SelectedValue));
            //3.更新用户职务状态
            usermodel.State.value     = 10;
            usermodel.CompanyID.value = WX.Main.DefaultCompanyId;
            usermodel.DepartmentID.set(ddlDepartment.SelectedValue);
            usermodel.DutyId.set(ui_jobname.SelectedValue);
            usermodel.ArchiveBySelf.value = 0;
            usermodel.Grade.value         = DropDownList1.SelectedValue;
            usermodel.Update();
            WX.Main.ExcuteUpdate("aspnet_Membership", "IsLockedOut=0", "UserID='" + usermodel.UserID.ToString() + "'");
            ULCode.QDA.XDataTable xdt = ULCode.QDA.XSql.GetXDataTable("select RealName from TU_Users  where DutyId=" + dutydetail.ID.ToString() + " and State>6 and State<40");
            dutydetail.UsersName.value = xdt.ToColValueList(",", 0);
            if (dutydetail.UsersName.ToString() != "")
            {
                dutydetail.UsersName.value = dutydetail.UsersName.ToString() + ",";
                dutydetail.Update();
            }
            //4.入职日志
            WX.HR.DutyLog.MODEL log = WX.HR.DutyLog.NewDataModel();
            log.UserID.value      = userId;
            log.NowDutyID.value   = usermodel.DutyId.value;
            log.NowDempID.value   = usermodel.DepartmentID.value;
            log.Backtableid.value = 0;
            log.Backcolumid.value = jobid;
            log.Starttime.value   = DateTime.Now;
            log.GradeID.value     = dutydetail.GradeID.value;
            log.Content.value     = "新员工入职";
            WX.HR.DutyLog.MODEL backlog = WX.HR.DutyLog.GetModel("select top 1 * from HR_DutyLogs where UserID='" + userId + "' order by Starttime desc");
            if (backlog != null)
            {
                backlog.stoptime.value   = DateTime.Now;
                backlog.Nowtableid.value = 0;
                backlog.Nowcolumid.value = jobid;
                backlog.Update();
            }
            log.Insert();
            //办理完入职1、向部门发送人员入职通知
            WX.Main.MessageSend(usermodel.RealName.ToString() + "已办理入职," + WX.CommonUtils.GetDeptNameListByDeptIdList(usermodel.DepartmentID.ToString()) + "接收——入职通知", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetDeptUserID(1, "[Host]", usermodel.DepartmentID.ToInt32()), WX.Main.CurUser.UserID, 8, 0);
            //2、向人资发送入职通知并提醒签合同、办保险
            WX.Main.MessageSend(usermodel.RealName.ToString() + "已办理入职——入职通知", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetHRUserID, WX.Main.CurUser.UserID, 8, 0);
            //3、向综管发送通知提示配备办公用品
            WX.Main.MessageSend("<a href=/Manage/Assets/Ass_AddConsuming.aspx?UserID=" + usermodel.UserID.ToString() + "&mes=1>" + WX.CommonUtils.GetDeptNameListByDeptIdList(usermodel.DepartmentID.ToString()) + "新来同事" + usermodel.RealName.ToString() + ",请配备办公用品——入职通知</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetCAUserID, WX.Main.CurUser.UserID, 8, 0);
            //4、向财务发送通知提示办理工资卡
            WX.Main.MessageSend("<a href=/Manage/Finance/FD_NewUserList.aspx?mes=1>" + WX.CommonUtils.GetDeptNameListByDeptIdList(usermodel.DepartmentID.ToString()) + "新来同事" + usermodel.RealName.ToString() + ",请办理工资卡等相关工作——入职通知</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetFDUserID, WX.Main.CurUser.UserID, 8, 0);
            //5、向入职人员发送入职办理清单
            WX.Main.MessageSend("<a href=/Manage/Private/IntoJobList.aspx?mes=1>欢迎加入我行大家庭!入职相关事宜请查看新人入职附表——入职通知</a>", "/Manage/Main/messagelist.aspx", usermodel.UserID.ToString(), WX.Main.CurUser.UserID, 8, 0);
            Response.Redirect("HR_Intojobs.aspx?state=10");
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.LoadHelperInfo();

            DataTable dtcount = ULCode.QDA.XSql.GetDataTable("exec Get_CRM_Tongji '" + WX.Main.CurUser.UserID + "'," + WX.Main.CurUser.UserModel.DepartmentID.ToInt32());

            limycount.Text     = dtcount.Rows[0]["mycount"].ToString();
            limyTempcount.Text = dtcount.Rows[0]["myTempcount"].ToString();

            string sql = "SELECT  case CustomerZJM when '' then CustomerName else CustomerZJM end CustomerName FROM CRM_CustomersTemp where State>-1 and EmployeeID='" + WX.Main.CurUser.UserID + "'"
                         + " union all "
                         + " SELECT  case CustomerZJM when '' then CustomerName else CustomerZJM end CustomerName FROM CRM_ContactTemp as cctemp left join CRM_Customers AS C  on cctemp.CustomerID=C.ID "
                         + " where cctemp.CheckState>-1 and  C.EmployeeID='" + WX.Main.CurUser.UserID + "'";

            ULCode.QDA.XDataTable tempdt = ULCode.QDA.XSql.GetXDataTable(sql);
            Literal1.Text = tempdt.ToColValueList(",", 0);
            Literal3.Text = dtcount.Rows[0]["myGTcount"].ToString();

            DataTable gtdt = ULCode.QDA.XSql.GetDataTable("select top 10 CustomerZJM  CustomerName,ID from CRM_Customers where EmployeeID='" + WX.Main.CurUser.UserID + "' and StageID<2 and State>0");

            Literal4.Text = this.GetCustomerNames(gtdt);
            Literal6.Text = dtcount.Rows[0]["myGZcount"].ToString();

            DataTable gzdt = ULCode.QDA.XSql.GetDataTable("select top 10 CustomerZJM  CustomerName,ID from CRM_Customers where EmployeeID='" + WX.Main.CurUser.UserID + "' and StageID=2 and State>0");

            Literal7.Text = this.GetCustomerNames(gzdt);
            Literal9.Text = dtcount.Rows[0]["myQYcount"].ToString();

            DataTable qydt = ULCode.QDA.XSql.GetDataTable("select top 10 CustomerZJM  CustomerName,ID from CRM_Customers where EmployeeID='" + WX.Main.CurUser.UserID + "' and StageID=3 and State>0");

            Literal10.Text = this.GetCustomerNames(qydt);
            Literal12.Text = dtcount.Rows[0]["myWHcount"].ToString();

            DataTable whdt = ULCode.QDA.XSql.GetDataTable("select top 10 CustomerZJM  CustomerName,ID from CRM_Customers where EmployeeID='" + WX.Main.CurUser.UserID + "' and StageID=4 and State>0");

            Literal13.Text = this.GetCustomerNames(whdt);

            Literal15.Text = dtcount.Rows[0]["cmpmonthcount"].ToString();
            Literal16.Text = dtcount.Rows[0]["deptmonthcount"].ToString();
            Literal17.Text = dtcount.Rows[0]["mymonthcount"].ToString();
            Literal18.Text = dtcount.Rows[0]["cmpmonthQYcount"].ToString();
            Literal19.Text = dtcount.Rows[0]["deptmonthQYcount"].ToString();
            Literal20.Text = dtcount.Rows[0]["mymonthQYcount"].ToString();
            Literal21.Text = dtcount.Rows[0]["cmpmonthGZcount"].ToString();
            Literal22.Text = dtcount.Rows[0]["deptmonthGZcount"].ToString();
            Literal23.Text = dtcount.Rows[0]["mymonthGZcount"].ToString();
            Literal24.Text = dtcount.Rows[0]["cmpmonthTrackcount"].ToString();
            Literal25.Text = dtcount.Rows[0]["deptmonthTrackcount"].ToString();
            Literal26.Text = dtcount.Rows[0]["mymonthTrackcount"].ToString();
            Literal27.Text = string.Format("{0:C2}", dtcount.Rows[0]["cmpmonthTrackfee"]);
            Literal28.Text = string.Format("{0:C2}", dtcount.Rows[0]["deptmonthTrackfee"]);
            Literal29.Text = string.Format("{0:C2}", dtcount.Rows[0]["mymonthTrackfee"]);

            Literal30.Text = dtcount.Rows[0]["cmpyearcount"].ToString();
            Literal35.Text = dtcount.Rows[0]["deptyearcount"].ToString();
            Literal40.Text = dtcount.Rows[0]["myyearcount"].ToString();
            Literal31.Text = dtcount.Rows[0]["cmpyearQYcount"].ToString();
            Literal36.Text = dtcount.Rows[0]["deptyearQYcount"].ToString();
            Literal41.Text = dtcount.Rows[0]["myyearQYcount"].ToString();
            Literal32.Text = dtcount.Rows[0]["cmpyearGZcount"].ToString();
            Literal37.Text = dtcount.Rows[0]["deptyearGZcount"].ToString();
            Literal42.Text = dtcount.Rows[0]["myyearGZcount"].ToString();
            Literal33.Text = dtcount.Rows[0]["cmpyearTrackcount"].ToString();
            Literal38.Text = dtcount.Rows[0]["deptyearTrackcount"].ToString();
            Literal43.Text = dtcount.Rows[0]["myyearTrackcount"].ToString();
            Literal34.Text = string.Format("{0:C2}", dtcount.Rows[0]["cmpyearTrackfee"]);
            Literal39.Text = string.Format("{0:C2}", dtcount.Rows[0]["deptyearTrackfee"]);
            Literal44.Text = string.Format("{0:C2}", dtcount.Rows[0]["myyearTrackfee"]);

            DataTable categorydt = ULCode.QDA.XSql.GetDataTable("select CategoryID,count(CategoryID) count,max(CategoryName) cname  from CRM_Customers cc left join CRM_InnerCategory cic on cc.CategoryID=cic.ID where EmployeeID='" + WX.Main.CurUser.UserID + "' and CategoryID is not null group by CategoryID ");

            for (int i = 0; i < categorydt.Rows.Count; i++)
            {
                Literal45.Text += (i > 0?",":"") + categorydt.Rows[i]["cname"] + categorydt.Rows[i]["count"] + "个";
            }
            DataTable Naturedt = ULCode.QDA.XSql.GetDataTable("select NatureID,count(NatureID) count,max(CompanyNature) cname  from CRM_Customers cc left join CRM_CompanyNature cin on cc.NatureID=cin.ID where EmployeeID='" + WX.Main.CurUser.UserID + "' and NatureID is not null group by NatureID");

            for (int i = 0; i < Naturedt.Rows.Count; i++)
            {
                Literal46.Text += (i > 0 ? "," : "") + Naturedt.Rows[i]["cname"] + Naturedt.Rows[i]["count"] + "个";
            }
            DataTable Sourcedt = ULCode.QDA.XSql.GetDataTable("select SourceID,count(SourceID) count,max(SourceName) cname  from CRM_Customers cc left join CRM_Source cs on cc.SourceID=cs.ID where EmployeeID='" + WX.Main.CurUser.UserID + "' and SourceID is not null group by SourceID ");

            for (int i = 0; i < Sourcedt.Rows.Count; i++)
            {
                Literal47.Text += (i > 0 ? "," : "") + Sourcedt.Rows[i]["cname"] + Sourcedt.Rows[i]["count"] + "个";
            }
            DataTable Industrydt = ULCode.QDA.XSql.GetDataTable("select IndustryID,count(IndustryID) count,max(IndustryName) cname  from CRM_Customers cc left join CRM_Industry ci on cc.IndustryID=ci.ID where EmployeeID='" + WX.Main.CurUser.UserID + "' and IndustryID is not null group by IndustryID");

            for (int i = 0; i < Industrydt.Rows.Count; i++)
            {
                Literal48.Text += (i > 0 ? "," : "") + Industrydt.Rows[i]["cname"] + Industrydt.Rows[i]["count"] + "个";
            }
        }