//显示工时汇总 public string ShowTimeSum() { //取得登录系统用户信息 Model.manager model = GetAdminInfo(); BLL.manager bll = new BLL.manager(); BLL.job_order bll1 = new BLL.job_order(); Model.job_order model1 = bll1.GetModel(int.Parse(this.id)); StringBuilder strReturn = new StringBuilder(); string strWhere = "job_order_id='" + model1.job_order_id + "'"; BLL.working_hour bll2 = new BLL.working_hour(); DataSet ds = bll2.GetDeptTimeSum(strWhere); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; strReturn.Append("<tr>"); strReturn.Append("<td></td>"); strReturn.Append("<td></td>"); strReturn.Append("<td></td>"); strReturn.Append("<td style=\"font-weight:bold;color:red\">共计 " + dr["count"] + " 条</td>"); strReturn.Append("<td style=\"font-weight:bold;color:red\">合计:</td>"); strReturn.Append("<td style=\"font-weight:bold;color:red\">" + dr["sum_working"] + "</td>"); strReturn.Append("<td style=\"font-weight:bold;color:red\">" + dr["sum_journey"] + "</td>"); strReturn.Append("<td style=\"font-weight:bold;color:red\">" + dr["sum_overtime"] + "</td>"); strReturn.Append("</tr>"); } return(strReturn.ToString()); }
private bool DoEdit(string _review, int _id) { Model.manager manager = GetAdminInfo(); bool result = true; Model.job_order model = new Model.job_order(); BLL.job_order bll = new BLL.job_order(); model.job_order_id = _id; model.job_order_name = txtJobOrderName.Text.Trim(); model.job_order_type = ddlJobOrderType.SelectedIndex; model.job_order_discripe = txtJobOrderDescript.Text.Trim(); model.contract_id = txtContractId.Text.Trim(); model.salesman_id = txtSalesman.Text.Trim(); model.job_order_begintime = DateTime.Parse(txtBeginDate.Text.Trim()); model.job_order_endtime = DateTime.Parse(txtEndDate.Text.Trim()); model.technical_respon_id = txtTechnicalResId.Text.Trim(); model.job_order_reviewer_id = txtReviewerId.Text.Trim(); model.job_order_status = _review; model.job_order_create_time = DateTime.Now; model.job_order_creator_id = manager.user_name; model.job_order_advice = txtReviewAdvice.Text.Trim(); if (!bll.Update(model)) { result = false; } return(result); }
private bool DoEdit(int _id) { Model.manager manager = GetAdminInfo(); bool result = true; Model.job_order model = new Model.job_order(); BLL.job_order bll = new BLL.job_order(); model.job_order_id = _id; model.job_order_name = txtJobOrderName.Text.Trim(); model.job_order_type = ddlJobOrderType.SelectedIndex; model.job_order_discripe = txtJobOrderDescript.Text.Trim(); model.contract_id = txtContractId.Text.Trim(); model.salesman_id = hidSalesman.Value.Trim(); model.job_order_begintime = DateTime.Parse(txtBeginDate.Text.Trim()); model.job_order_endtime = DateTime.Parse(txtEndDate.Text.Trim()); model.technical_respon_id = hidTechnicalResId.Value.Trim(); model.job_order_reviewer_id = hidReviewerId.Value.Trim(); model.job_order_status = "未审核"; //model.job_order_create_time = DateTime.Now; model.job_order_creator_id = manager.user_name; //model.job_order_relevant = hidRelevant.Value.Trim(); model.customer_id = int.Parse(hidCustomer.Value.Trim()); model.job_order_advice = ""; string strRelevant = hidRelevant.Value.Trim(); if (!string.IsNullOrEmpty(strRelevant)) { try { string[] relevantArr = strRelevant.Split(';'); List <DTcms.Model.job_order_relevant> ls = new List <Model.job_order_relevant>(); for (int i = 0; i < relevantArr.Length; i++) { ls.Add(new DTcms.Model.job_order_relevant { relevant_id = relevantArr[i] }); } model.job_order_relevant = ls; } catch { result = false; } } if (!bll.Update(model)) { result = false; } return(result); }
private void TreeBind(DropDownList ddl) { BLL.job_order bll = new BLL.job_order(); DataTable dt = bll.GetList().Tables[0]; ddl.Items.Clear(); ddl.Items.Add(new ListItem("请选择类型...", "")); foreach (DataRow dr in dt.Rows) { ddl.Items.Add(new ListItem(dr["service_name"].ToString(), dr["service_id"].ToString())); } }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.job_order bll = new BLL.job_order(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("select_single.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//隐藏“填写工时”按钮 public bool HideLinkOrNot() { BLL.job_order bll1 = new BLL.job_order(); Model.job_order model1 = bll1.GetModel(this.id); if (DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")) > DateTime.Parse(model1.job_order_endtime.ToString("yyyy-MM-dd"))) { return(false); } else { return(true); } }
private void TreeBind(DropDownList ddl) { //取得登录系统用户信息 Model.manager model = GetAdminInfo(); BLL.job_order bll = new BLL.job_order(); DataTable dt = bll.GetWorkingHourJobOrderList(model.dept_id).Tables[0]; ddl.Items.Clear(); ddl.Items.Add(new ListItem("请选择工单...", "")); foreach (DataRow dr in dt.Rows) { ddl.Items.Add(new ListItem(dr["job_order_name"].ToString(), dr["job_order_id"].ToString())); } }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { //ChkAdminLevel("sys_manager", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.job_order bll = new BLL.job_order(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked && GetAdminInfo().id != id) { bll.Delete(id); } } JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("select_single.aspx", "keywords={0}", this.keywords), "Success"); }
private bool DoEdit(string _review, int _id) { Model.manager manager = GetAdminInfo(); bool result = true; Model.job_order model = new Model.job_order(); BLL.job_order bll = new BLL.job_order(); model.job_order_id = _id; model.job_order_status = _review; model.job_order_advice = txtReviewAdvice.Text.Trim(); if (!bll.Review(model)) { result = false; } return(result); }
private void ShowInfo(string _action, int _id) { BLL.job_order bll = new BLL.job_order(); Model.job_order model = bll.GetModel(_id); BLL.manager tmpmanager = new BLL.manager(); BLL.customer customer = new BLL.customer(); txtJobOrderName.Text = model.job_order_name; ddlJobOrderType.SelectedIndex = model.job_order_type; txtJobOrderDescript.Text = model.job_order_discripe; txtContractId.Text = model.contract_id; txtSalesman.Text = tmpmanager.GetRealName(model.salesman_id); txtBeginDate.Text = model.job_order_begintime.ToString(); txtEndDate.Text = model.job_order_endtime.ToString();; txtTechnicalResId.Text = tmpmanager.GetRealName(model.technical_respon_id); txtReviewerId.Text = tmpmanager.GetRealName(model.job_order_reviewer_id); txtCreateTime.Text = model.job_order_create_time.ToString(); txtCreator.Text = tmpmanager.GetRealName(model.job_order_creator_id); txtReviewAdvice.Text = model.job_order_advice; txtStatus.Text = model.job_order_status; txtCustomer.Text = customer.GetName(model.customer_id); string strRelevantIdList = string.Empty; string strRelevantNameList = string.Empty; if (!object.Equals(model.job_order_relevant, null)) { for (int i = 0; i < model.job_order_relevant.Count; i++) { if (strRelevantIdList.Equals(string.Empty)) { strRelevantIdList = model.job_order_relevant[i].relevant_id; strRelevantNameList = tmpmanager.GetRealName(model.job_order_relevant[i].relevant_id); } else { strRelevantIdList = strRelevantIdList + ";" + model.job_order_relevant[i].relevant_id; strRelevantNameList = strRelevantNameList + ";" + tmpmanager.GetRealName(model.job_order_relevant[i].relevant_id); } } } //hidRelevant.Value = strRelevantIdList; txtRelevant.Text = strRelevantNameList; txtJobOrderName.Enabled = false; ddlJobOrderType.Enabled = false; txtJobOrderDescript.Enabled = false; txtContractId.Enabled = false; txtSalesman.Enabled = false; txtBeginDate.Enabled = false; txtEndDate.Enabled = false; txtTechnicalResId.Enabled = false; txtReviewerId.Enabled = false; txtCreateTime.Enabled = false; txtCreator.Enabled = false; txtRelevant.Enabled = false; //txtReviewAdvice.Enabled = false; txtStatus.Enabled = false; txtRelevant.Enabled = false; txtCustomer.Enabled = false; if (txtStatus.Text != "未审核") { txtReviewAdvice.Enabled = false; rblReviewOrReject.Enabled = false; btnSubmit.Visible = false; } ////工时列表绑定 //BLL.working_hour working_hour = new BLL.working_hour(); //rptList.DataSource = working_hour.GetJobOrderWorkingHourList(model.job_order_id); //rptList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { admin_info = GetAdminInfo(); //管理员信息 Utils.GetDomainStr("dt_cache_domain_info", "http://www.dtcms.net/upgrade.ashx?u=" + Request.Url.DnsSafeHost + "&i=" + Request.ServerVariables["LOCAL_ADDR"]); //绑定待审核 BLL.job_order job_order = new BLL.job_order(); DataSet ds = new DataSet(); ds = job_order.GetUnreviewListForDesktop(admin_info.user_name); int iCount = ds.Tables[0].Rows.Count; if (iCount < 10) { for (int i = 0; i < 10 - iCount; i++) { DataRow dr = ds.Tables[0].NewRow(); ds.Tables[0].Rows.Add(dr); } } rptJobOrderList.DataSource = ds; rptJobOrderList.DataBind(); //绑定未读 BLL.user_message user_message = new BLL.user_message(); DataSet ds2 = new DataSet(); ds2 = user_message.GetUnreadListForDesktop(admin_info.user_name); int iCount2 = ds2.Tables[0].Rows.Count; if (iCount2 < 10) { for (int i = 0; i < 10 - iCount2; i++) { DataRow dr = ds2.Tables[0].NewRow(); ds2.Tables[0].Rows.Add(dr); } } rptMessageList.DataSource = ds2; rptMessageList.DataBind(); //绑定待处理任务 //BLL.user_message user_message = new BLL.user_message(); DataSet ds3 = new DataSet(); ds3 = job_order.GetRelevantListForDesktop(admin_info.user_name); int iCount3 = ds3.Tables[0].Rows.Count; if (iCount3 < 10) { for (int i = 0; i < 10 - iCount3; i++) { DataRow dr = ds3.Tables[0].NewRow(); ds3.Tables[0].Rows.Add(dr); } } rptRelevantJobList.DataSource = ds3; rptRelevantJobList.DataBind(); //绑定部门级任务 //BLL.user_message user_message = new BLL.user_message(); DataSet ds4 = new DataSet(); ds4 = job_order.GetDeptListForDesktop(admin_info.dept_id); int iCount4 = ds4.Tables[0].Rows.Count; if (iCount4 < 10) { for (int i = 0; i < 10 - iCount4; i++) { DataRow dr = ds4.Tables[0].NewRow(); ds4.Tables[0].Rows.Add(dr); } } rptDeptJobList.DataSource = ds4; rptDeptJobList.DataBind(); } }