Example #1
0
        //显示工时汇总
        public string ShowTimeSum()
        {
            //取得登录系统用户信息
            Model.manager model = GetAdminInfo();
            BLL.manager   bll   = new BLL.manager();

            StringBuilder strReturn = new StringBuilder();
            string        strWhere  = "dept_id=" + "'" + model.dept_id + "' and (role_value>" + bll.GetRoleValue(model.role_id) + " or user_name='" + model.user_name + "')" + CombSqlTxt(this.datebegin, this.dateend, ddlJobOrder.SelectedValue);

            BLL.working_hour bll1 = new BLL.working_hour();
            DataSet          ds   = bll1.GetDeptTimeSum(strWhere);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr = ds.Tables[0].Rows[0];

                strReturn.Append("<tr>");
                strReturn.Append("<td colspan=4></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\" colspan=2>" + dr["sum_overtime"] + "</td>");
                strReturn.Append("</tr>");
            }

            return(strReturn.ToString());
        }
Example #2
0
        private void ShowInfo(string _action, int _id)
        {
            BLL.working_hour   bll   = new BLL.working_hour();
            Model.working_hour model = bll.GetModel(_id);

            BLL.manager tmpmanager = new BLL.manager();

            if (_action == DTEnums.ActionEnum.Edit.ToString()) //修改
            {
                txtDate.Text                 = model.date.ToString("yyyy-MM-dd");
                txtJobOrderName.Text         = bll.GetJobOrderName(model.job_order_id);
                hidJobOrderId.Value          = model.job_order_id.ToString();
                ddlProductType.SelectedIndex = model.product_type;
                ddlServiceType.SelectedIndex = model.service_type;
                txtWorkingContent.Text       = model.working_content;
                ddlStatus.SelectedIndex      = model.status;
                txtWorkingHours.Text         = model.working_hours.ToString();
                txtJourneyHours.Text         = model.journey_hours.ToString();
                txtOvertimeHours.Text        = model.overtime_hours.ToString();

                //绑定附件
                rptAttach.DataSource = model.download_attachs;
                rptAttach.DataBind();
            }
            else if (_action == DTEnums.ActionEnum.View.ToString()) //查看
            {
                txtDate.Text                 = model.date.ToString("yyyy-MM-dd");
                txtJobOrderName.Text         = bll.GetJobOrderName(model.job_order_id);
                hidJobOrderId.Value          = model.job_order_id.ToString();
                ddlProductType.SelectedIndex = model.product_type;
                ddlServiceType.SelectedIndex = model.service_type;
                txtWorkingContent.Text       = model.working_content;
                ddlStatus.SelectedIndex      = model.status;
                txtWorkingHours.Text         = model.working_hours.ToString();
                txtJourneyHours.Text         = model.journey_hours.ToString();
                txtOvertimeHours.Text        = model.overtime_hours.ToString();

                txtDate.Enabled           = false;
                txtJobOrderName.Enabled   = false;
                ddlProductType.Enabled    = false;
                ddlServiceType.Enabled    = false;
                txtWorkingContent.Enabled = false;
                ddlStatus.Enabled         = false;
                ddlProductType.Enabled    = false;
                txtJourneyHours.Enabled   = false;
                txtOvertimeHours.Enabled  = false;
                txtWorkingHours.Enabled   = false;

                btnSubmit.Visible = false;

                //绑定附件
                rptAttach.DataSource = model.download_attachs;
                rptAttach.DataBind();
            }
            else
            {
                hidJobOrderId.Value  = this.job_order_id;
                txtJobOrderName.Text = this.job_order_name;
            }
        }
Example #3
0
        //显示工时汇总
        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());
        }
Example #4
0
        private bool DoEdit(int _id)
        {
            Model.manager manager = GetAdminInfo();

            bool result = true;

            Model.working_hour model = new Model.working_hour();
            BLL.working_hour   bll   = new BLL.working_hour();

            model.id              = this.id;
            model.date            = DateTime.Parse(txtDate.Text.Trim());
            model.job_order_id    = Convert.ToInt32(hidJobOrderId.Value.Trim());
            model.product_type    = Convert.ToByte(ddlProductType.SelectedIndex);
            model.service_type    = Convert.ToByte(ddlServiceType.SelectedIndex);
            model.working_content = txtWorkingContent.Text.Trim();
            model.status          = Convert.ToByte(ddlStatus.SelectedIndex);
            model.working_hours   = decimal.Parse(txtWorkingHours.Text.ToString());
            model.journey_hours   = decimal.Parse(txtJourneyHours.Text.ToString());
            model.overtime_hours  = decimal.Parse(txtOvertimeHours.Text.ToString());

            //保存附件
            if (model.download_attachs != null)
            {
                model.download_attachs.Clear();
            }
            string hidFileList = Request.Params["hidFileName"];

            if (!string.IsNullOrEmpty(hidFileList))
            {
                string[] fileListArr            = hidFileList.Split(',');
                List <Model.download_attach> ls = new List <Model.download_attach>();
                for (int i = 0; i < fileListArr.Length; i++)
                {
                    string[] fileArr = fileListArr[i].Split('|');
                    if (fileArr.Length == 3)
                    {
                        int    attach_id = int.Parse(fileArr[0]);
                        int    fileSize  = Utils.GetFileSize(fileArr[2]);
                        string fileExt   = Utils.GetFileExt(fileArr[2]);
                        //删除旧文件
                        if (attach_id > 0)
                        {
                            new BLL.download_attach().DeleteFile(attach_id, fileArr[2]);
                        }
                        ls.Add(new Model.download_attach {
                            id = attach_id, article_id = _id, title = fileArr[1], file_path = fileArr[2], file_size = fileSize, file_ext = fileExt
                        });
                    }
                }
                model.download_attachs = ls;
            }

            if (!bll.Update(model))
            {
                result = false;
            }

            return(result);
        }
Example #5
0
        private void TreeBind(DropDownList ddl, string table)
        {
            BLL.working_hour bll = new BLL.working_hour();
            DataTable        dt  = bll.GetTypeList(table).Tables[0];

            ddl.Items.Clear();
            ddl.Items.Add(new ListItem("请选择类型...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                ddl.Items.Add(new ListItem(dr["name"].ToString(), dr["id"].ToString()));
            }
        }
Example #6
0
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     //ChkAdminLevel("sys_manager", DTEnums.ActionEnum.Delete.ToString()); //检查权限
     BLL.working_hour bll = new BLL.working_hour();
     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("my_list.aspx", "datebegin={0}", "dateend={1}", this.datebegin, this.dateend), "Success");
 }
Example #7
0
        private bool DoAdd()
        {
            bool result = true;

            Model.working_hour model = new Model.working_hour();
            BLL.working_hour   bll   = new BLL.working_hour();

            model.user_name = manager.user_name;
            model.date      = DateTime.Parse(txtDate.Text.Trim());
            //model.job_order_id = int.Parse(hidJobOrderId.Value.Trim());
            model.job_order_id    = Convert.ToInt32(hidJobOrderId.Value.Trim());
            model.product_type    = Convert.ToByte(ddlProductType.SelectedIndex);
            model.service_type    = Convert.ToByte(ddlServiceType.SelectedIndex);
            model.working_content = txtWorkingContent.Text.Trim();
            model.status          = Convert.ToByte(ddlStatus.SelectedIndex);
            model.working_hours   = decimal.Parse(txtWorkingHours.Text.ToString());
            model.journey_hours   = decimal.Parse(txtJourneyHours.Text.ToString());
            model.overtime_hours  = decimal.Parse(txtOvertimeHours.Text.ToString());
            model.create_time     = DateTime.Now;

            //保存附件
            string hidFileList = Request.Params["hidFileName"];

            if (!string.IsNullOrEmpty(hidFileList))
            {
                string[] fileListArr            = hidFileList.Split(',');
                List <Model.download_attach> ls = new List <Model.download_attach>();
                for (int i = 0; i < fileListArr.Length; i++)
                {
                    string[] fileArr = fileListArr[i].Split('|');
                    if (fileArr.Length == 3)
                    {
                        int    fileSize = Utils.GetFileSize(fileArr[2]);
                        string fileExt  = Utils.GetFileExt(fileArr[2]);
                        ls.Add(new Model.download_attach {
                            id = int.Parse(fileArr[0]), title = fileArr[1], file_path = fileArr[2], file_size = fileSize, file_ext = fileExt
                        });
                    }
                }
                model.download_attachs = ls;
            }

            if (bll.Add(model) < 1)
            {
                result = false;
            }
            return(result);
        }
Example #8
0
 private void RptBind(string _strWhere)
 {
     BLL.working_hour bll = new BLL.working_hour();
     this.rptList.DataSource = bll.GetDeptWorkingHourList(_strWhere);
     this.rptList.DataBind();
 }
Example #9
0
        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();

            this.name = model.job_order_name;

            txtJobOrderName.Text          = model.job_order_name;
            txtJobOrderName.Enabled       = false;
            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("yyyy-MM-dd");
            txtEndDate.Text        = model.job_order_endtime.ToString("yyyy-MM-dd");;
            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;

            //工时列表绑定
            BLL.working_hour working_hour = new BLL.working_hour();

            rptList.DataSource = working_hour.GetJobOrderWorkingHourList(model.job_order_id);
            rptList.DataBind();
        }