Example #1
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            if (!string.IsNullOrEmpty(_goods))
            {
                ddlGoods.SelectedValue = _goods;
            }
            if (!string.IsNullOrEmpty(_customer1))
            {
                ddlCustomer1.SelectedValue = _customer1;
            }
            if (!string.IsNullOrEmpty(_customer2))
            {
                ddlCustomer2.SelectedValue = _customer2;
            }
            if (!string.IsNullOrEmpty(_beginTime))
            {
                txtBeginTime.Text = _beginTime;
            }
            if (!string.IsNullOrEmpty(_endTime))
            {
                txtEndTime.Text = _endTime;
            }
            this.txtKeywords.Text = this.keywords;
            BLL.Order bll = new BLL.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("order_list.aspx", "goods={0}&customer1={1}&customer2={2}&beginTime={3}&endTime={4}&keywords={5}&page={6}",
                                              _goods, _customer1, _customer2, _beginTime, _endTime, this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Example #2
0
        private void RptBind(string _strWhere, string _orderby)
        {
            if (!this.isSearch)
            {
                this.page = DTRequest.GetQueryInt("page", 1);
            }
            else
            {
                this.page = 1;
            }
            BLL.Order bll = new BLL.Order();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount, false, "", true, orderType, currentUser);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = backUrl();

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);

            txtOrderID.Text = _orderid;
            txtCusName.Text = _cusName;
            hCusId.Value    = _cid;
            ddlContractPrice.SelectedValue = _contractPrice;
            ddlstatus.SelectedValue        = _status;
            ddldstatus.SelectedValue       = _dstatus;
            ddlispush.SelectedValue        = _pushstatus;
            ddlflag.SelectedValue          = _flag;
            ddllock.SelectedValue          = _lockstatus;
            txtContent.Text            = _content;
            txtAddress.Text            = _address;
            ddlmoneyType.SelectedValue = _moneyType;
            ddlsign.SelectedValue      = _sign;
            txtMoney.Text         = _money;
            txtPerson1.Text       = _person1;
            txtPerson2.Text       = _person2;
            txtPerson3.Text       = _person3;
            txtPerson4.Text       = _person4;
            txtPerson5.Text       = _person5;
            txtsDate.Text         = _sdate;
            txteDate.Text         = _edate;
            txtsDate1.Text        = _sdate1;
            txteDate1.Text        = _edate1;
            ddlarea.SelectedValue = _area;
            txtsDate2.Text        = _sdate2;
            txteDate2.Text        = _edate2;
        }
Example #3
0
        private void TreeBind(string strWhere)
        {
            BLL.Motorcade bll = new BLL.Motorcade();
            DataTable     dt  = bll.GetList(0, strWhere, "Id desc").Tables[0];

            ddlMotorcade.Items.Clear();
            ddlMotorcade.Items.Add(new ListItem("请选择车队", ""));
            foreach (DataRow dr in dt.Rows)
            {
                this.ddlMotorcade.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString()));
            }
            ddlMotorcade.SelectedIndex = 0;

            string motorcadeName = ddlMotorcade.SelectedValue;

            BLL.Vehicle vehicleBll = new BLL.Vehicle();
            ddlCarNumber.Items.Clear();
            ddlCarNumber.Items.Add(new ListItem("请选择车辆", ""));
            if (!string.IsNullOrEmpty(motorcadeName))
            {
                DataTable vehicledt = vehicleBll.GetList(0, " MotorcadeName = '" + motorcadeName + "' ", "Id desc").Tables[0];

                foreach (DataRow dr in vehicledt.Rows)
                {
                    this.ddlCarNumber.Items.Add(new ListItem(dr["CarCode"].ToString(), dr["CarCode"].ToString()));
                }
            }
            else
            {
                DataTable vehicledt = vehicleBll.GetList(0, "", "Id desc").Tables[0];

                foreach (DataRow dr in vehicledt.Rows)
                {
                    this.ddlCarNumber.Items.Add(new ListItem(dr["CarCode"].ToString(), dr["CarCode"].ToString()));
                }
            }

            BLL.Order orderBll = new BLL.Order();
            this.rptList.DataSource = orderBll.GetList(" Quantity > DispatchedCount or (IsCharteredCar = 1 and DispatchedCount = 0.00)");
            this.rptList.DataBind();
        }
Example #4
0
        protected void btnExcel_Click(object sender, EventArgs e)
        {
            flag           = DTRequest.GetFormString("flag");
            _type          = DTRequest.GetFormString("type");
            _orderid       = DTRequest.GetFormString("txtOrderID");
            _cusName       = DTRequest.GetFormString("txtCusName");
            _cid           = DTRequest.GetFormString("hCusId");
            _contractPrice = DTRequest.GetFormString("ddlContractPrice");
            _status        = DTRequest.GetFormString("ddlstatus");
            _dstatus       = DTRequest.GetFormString("ddldstatus");
            _pushstatus    = DTRequest.GetFormString("ddlispush");
            _flag          = DTRequest.GetFormString("ddlflag");
            _lockstatus    = DTRequest.GetFormString("ddllock");
            _content       = DTRequest.GetFormString("txtContent");
            _address       = DTRequest.GetFormString("txtAddress");
            _sign          = DTRequest.GetFormString("ddlsign");
            _money         = DTRequest.GetFormString("txtMoney");
            _person1       = DTRequest.GetFormString("txtPerson1");
            _person2       = DTRequest.GetFormString("txtPerson2");
            _person3       = DTRequest.GetFormString("txtPerson3");
            _person4       = DTRequest.GetFormString("txtPerson4");
            _person5       = DTRequest.GetFormString("txtPerson5");
            _sdate         = DTRequest.GetFormString("txtsDate");
            _edate         = DTRequest.GetFormString("txteDate");
            _sdate1        = DTRequest.GetFormString("txtsDate1");
            _edate1        = DTRequest.GetFormString("txteDate1");
            _sdate2        = DTRequest.GetFormString("txtsDate2");
            _edate2        = DTRequest.GetFormString("txteDate2");
            _area          = DTRequest.GetFormString("ddlarea");
            _orderarea     = DTRequest.GetFormString("ddlorderarea");
            BLL.Order bll = new BLL.Order();
            DataTable dt  = bll.GetList(this.pageSize, this.page, "1=1" + CombSqlTxt(), whereOrderBy, out this.totalCount, false, "", false, orderType, currentUser).Tables[0];

            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=订单列表.xlsx"); //HttpUtility.UrlEncode(fileName));
            HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";

            HSSFWorkbook hssfworkbook = new HSSFWorkbook();
            ISheet       sheet        = hssfworkbook.CreateSheet("明细");
            IFont        font         = hssfworkbook.CreateFont();

            font.Boldweight         = short.MaxValue;
            font.FontHeightInPoints = 11;

            #region 表格样式
            //设置单元格的样式:水平垂直对齐居中
            ICellStyle cellStyle = hssfworkbook.CreateCellStyle();
            cellStyle.Alignment         = HorizontalAlignment.Center;
            cellStyle.VerticalAlignment = VerticalAlignment.Center;
            cellStyle.BorderBottom      = BorderStyle.Thin;
            cellStyle.BorderLeft        = BorderStyle.Thin;
            cellStyle.BorderRight       = BorderStyle.Thin;
            cellStyle.BorderTop         = BorderStyle.Thin;
            cellStyle.BottomBorderColor = HSSFColor.Black.Index;
            cellStyle.LeftBorderColor   = HSSFColor.Black.Index;
            cellStyle.RightBorderColor  = HSSFColor.Black.Index;
            cellStyle.TopBorderColor    = HSSFColor.Black.Index;
            cellStyle.WrapText          = true;//自动换行

            //设置表头的样式:水平垂直对齐居中,加粗
            ICellStyle titleCellStyle = hssfworkbook.CreateCellStyle();
            titleCellStyle.Alignment           = HorizontalAlignment.Center;
            titleCellStyle.VerticalAlignment   = VerticalAlignment.Center;
            titleCellStyle.FillForegroundColor = HSSFColor.Grey25Percent.Index; //图案颜色
            titleCellStyle.FillPattern         = FillPattern.SparseDots;        //图案样式
            titleCellStyle.FillBackgroundColor = HSSFColor.Grey25Percent.Index; //背景颜色
            //设置边框
            titleCellStyle.BorderBottom      = BorderStyle.Thin;
            titleCellStyle.BorderLeft        = BorderStyle.Thin;
            titleCellStyle.BorderRight       = BorderStyle.Thin;
            titleCellStyle.BorderTop         = BorderStyle.Thin;
            titleCellStyle.BottomBorderColor = HSSFColor.Black.Index;
            titleCellStyle.LeftBorderColor   = HSSFColor.Black.Index;
            titleCellStyle.RightBorderColor  = HSSFColor.Black.Index;
            titleCellStyle.TopBorderColor    = HSSFColor.Black.Index;
            //设置字体
            titleCellStyle.SetFont(font);
            #endregion
            //表头
            IRow headRow = sheet.CreateRow(0);
            headRow.HeightInPoints = 25;

            headRow.CreateCell(0).SetCellValue("订单号");
            headRow.CreateCell(1).SetCellValue("活动名称");
            headRow.CreateCell(2).SetCellValue("活动地点");
            headRow.CreateCell(3).SetCellValue("客户");
            headRow.CreateCell(4).SetCellValue("合同造价");
            headRow.CreateCell(5).SetCellValue("活动日期");
            headRow.CreateCell(6).SetCellValue("归属地");
            headRow.CreateCell(7).SetCellValue("订单状态");
            headRow.CreateCell(8).SetCellValue("推送状态");
            headRow.CreateCell(9).SetCellValue("上级审批");
            headRow.CreateCell(10).SetCellValue("锁单状态");
            headRow.CreateCell(11).SetCellValue("业务员");
            headRow.CreateCell(12).SetCellValue("报账人员");
            headRow.CreateCell(13).SetCellValue("策划人员");
            headRow.CreateCell(14).SetCellValue("设计人员");
            headRow.CreateCell(15).SetCellValue("应收款");
            headRow.CreateCell(16).SetCellValue("未收款");
            headRow.CreateCell(17).SetCellValue("业绩利润");
            headRow.CreateCell(18).SetCellValue("确认时间");

            headRow.GetCell(0).CellStyle  = titleCellStyle;
            headRow.GetCell(1).CellStyle  = titleCellStyle;
            headRow.GetCell(2).CellStyle  = titleCellStyle;
            headRow.GetCell(3).CellStyle  = titleCellStyle;
            headRow.GetCell(4).CellStyle  = titleCellStyle;
            headRow.GetCell(5).CellStyle  = titleCellStyle;
            headRow.GetCell(6).CellStyle  = titleCellStyle;
            headRow.GetCell(7).CellStyle  = titleCellStyle;
            headRow.GetCell(8).CellStyle  = titleCellStyle;
            headRow.GetCell(9).CellStyle  = titleCellStyle;
            headRow.GetCell(10).CellStyle = titleCellStyle;
            headRow.GetCell(11).CellStyle = titleCellStyle;
            headRow.GetCell(12).CellStyle = titleCellStyle;
            headRow.GetCell(13).CellStyle = titleCellStyle;
            headRow.GetCell(14).CellStyle = titleCellStyle;
            headRow.GetCell(15).CellStyle = titleCellStyle;
            headRow.GetCell(16).CellStyle = titleCellStyle;
            headRow.GetCell(17).CellStyle = titleCellStyle;
            headRow.GetCell(18).CellStyle = titleCellStyle;

            sheet.SetColumnWidth(0, 15 * 256);
            sheet.SetColumnWidth(1, 20 * 256);
            sheet.SetColumnWidth(2, 20 * 256);
            sheet.SetColumnWidth(3, 20 * 256);
            sheet.SetColumnWidth(4, 20 * 256);
            sheet.SetColumnWidth(5, 30 * 256);
            sheet.SetColumnWidth(6, 20 * 256);
            sheet.SetColumnWidth(7, 20 * 256);
            sheet.SetColumnWidth(8, 20 * 256);
            sheet.SetColumnWidth(9, 20 * 256);
            sheet.SetColumnWidth(10, 15 * 256);
            sheet.SetColumnWidth(11, 15 * 256);
            sheet.SetColumnWidth(12, 15 * 256);
            sheet.SetColumnWidth(13, 15 * 256);
            sheet.SetColumnWidth(14, 15 * 256);
            sheet.SetColumnWidth(15, 15 * 256);
            sheet.SetColumnWidth(16, 15 * 256);
            sheet.SetColumnWidth(17, 15 * 256);
            sheet.SetColumnWidth(18, 25 * 256);

            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    IRow row = sheet.CreateRow(i + 1);
                    row.HeightInPoints = 22;
                    row.CreateCell(0).SetCellValue(dt.Rows[i]["o_id"].ToString());
                    row.CreateCell(1).SetCellValue(Utils.ObjectToStr(dt.Rows[i]["o_content"]));
                    row.CreateCell(2).SetCellValue(Utils.ObjectToStr(dt.Rows[i]["o_address"]));
                    row.CreateCell(3).SetCellValue(Utils.ObjectToStr(dt.Rows[i]["c_name"]));
                    row.CreateCell(4).SetCellValue(Utils.ObjectToStr(dt.Rows[i]["o_contractPrice"]));
                    row.CreateCell(5).SetCellValue(ConvertHelper.toDate(dt.Rows[i]["o_sdate"]).Value.ToString("yyyy-MM-dd") + "/" + ConvertHelper.toDate(dt.Rows[i]["o_sdate"]).Value.ToString("yyyy-MM-dd"));
                    row.CreateCell(6).SetCellValue(new BLL.department().getAreaText(Utils.ObjectToStr(dt.Rows[i]["o_place"])));
                    row.CreateCell(7).SetCellValue(BusinessDict.fStatus()[Utils.ObjToByte(dt.Rows[i]["o_status"])]);
                    row.CreateCell(8).SetCellValue(BusinessDict.pushStatus()[Utils.StrToBool(Utils.ObjectToStr(dt.Rows[i]["o_isPush"]), false)]);
                    row.CreateCell(9).SetCellValue(BusinessDict.checkStatus()[Utils.ObjToByte(dt.Rows[i]["o_flag"])]);
                    row.CreateCell(10).SetCellValue(BusinessDict.lockStatus()[Utils.ObjToByte(dt.Rows[i]["o_lockStatus"])]);
                    row.CreateCell(11).SetCellValue(dt.Rows[i]["op_name"].ToString());
                    row.CreateCell(12).SetCellValue(dt.Rows[i]["person2"].ToString());
                    row.CreateCell(13).SetCellValue(dt.Rows[i]["person3"].ToString());
                    row.CreateCell(14).SetCellValue(dt.Rows[i]["person4"].ToString());
                    row.CreateCell(15).SetCellValue(dt.Rows[i]["finMoney"].ToString());
                    row.CreateCell(16).SetCellValue(dt.Rows[i]["unMoney"].ToString());
                    row.CreateCell(17).SetCellValue(dt.Rows[i]["profit"].ToString());
                    row.CreateCell(18).SetCellValue(Utils.ObjectToStr(dt.Rows[i]["o_statusTime"]) == ""?"":Utils.ObjectToDateTime(dt.Rows[i]["o_statusTime"]).ToString("yyyy-MM-dd HH:mm:ss"));

                    row.GetCell(0).CellStyle  = cellStyle;
                    row.GetCell(1).CellStyle  = cellStyle;
                    row.GetCell(2).CellStyle  = cellStyle;
                    row.GetCell(3).CellStyle  = cellStyle;
                    row.GetCell(4).CellStyle  = cellStyle;
                    row.GetCell(5).CellStyle  = cellStyle;
                    row.GetCell(6).CellStyle  = cellStyle;
                    row.GetCell(7).CellStyle  = cellStyle;
                    row.GetCell(8).CellStyle  = cellStyle;
                    row.GetCell(9).CellStyle  = cellStyle;
                    row.GetCell(10).CellStyle = cellStyle;
                    row.GetCell(11).CellStyle = cellStyle;
                    row.GetCell(12).CellStyle = cellStyle;
                    row.GetCell(13).CellStyle = cellStyle;
                    row.GetCell(14).CellStyle = cellStyle;
                    row.GetCell(15).CellStyle = cellStyle;
                    row.GetCell(16).CellStyle = cellStyle;
                    row.GetCell(17).CellStyle = cellStyle;
                    row.GetCell(18).CellStyle = cellStyle;
                }
            }

            MemoryStream file = new MemoryStream();
            hssfworkbook.Write(file);

            HttpContext.Current.Response.BinaryWrite(file.GetBuffer());
            HttpContext.Current.Response.End();
        }
Example #5
0
        private void ShowInfo(string _oid)
        {
            rptEmployee0.Visible = false;
            liemployee0.Visible  = false;
            BLL.Order bll = new BLL.Order();
            DataSet   ds  = bll.GetList(0, "o_id='" + _oid + "'", "o_addDate desc");

            if (ds == null || ds.Tables[0].Rows.Count == 0)
            {
                JscriptMsg("订单不存在!", "");
                return;
            }
            DataRow dr = ds.Tables[0].Rows[0];

            labOwner.Text   = new MettingSys.BLL.department().getAreaText(dr["op_area"].ToString()) + "," + dr["op_number"] + "," + dr["op_name"];
            txtCusName.Text = dr["c_name"].ToString();
            hCusId.Value    = dr["c_id"].ToString();
            List <Model.Contacts> contactlist = new BLL.Contacts().getList("co_cid=" + hCusId.Value + "", " co_flag desc,co_id asc");

            if (contactlist != null)
            {
                ddlcontact.DataSource     = contactlist;
                ddlcontact.DataTextField  = "co_name";
                ddlcontact.DataValueField = "co_id";
                ddlcontact.DataBind();
            }
            ddlcontact.SelectedValue       = dr["o_coid"].ToString();
            txtPhone.Text                  = dr["co_number"].ToString();
            ddlcontractPrice.SelectedValue = dr["o_contractPrice"].ToString();
            txtsDate.Text                  = ConvertHelper.toDate(dr["o_sdate"]).Value.ToString("yyyy-MM-dd");
            txteDate.Text                  = ConvertHelper.toDate(dr["o_edate"]).Value.ToString("yyyy-MM-dd");
            txtAddress.Text                = dr["o_address"].ToString();
            txtContent.Text                = dr["o_content"].ToString();
            txtContract.Text               = dr["o_contractContent"].ToString();
            txtRemark.Text                 = dr["o_remarks"].ToString();
            ddlfStatus.SelectedValue       = dr["o_status"].ToString();
            //ddldstatus.SelectedValue = dr["o_dstatus"].ToString();
            ddlpushStatus.SelectedValue = dr["o_isPush"].ToString();
            labFlag.Text          = Common.BusinessDict.checkStatus()[Utils.ObjToByte(dr["o_flag"])];
            ddlflag.SelectedValue = dr["o_flag"].ToString();
            labLockStatus.Text    = Common.BusinessDict.lockStatus()[Utils.ObjToByte(dr["o_lockStatus"])];
            labfinanceCost.Text   = dr["o_financeCust"].ToString();
            txtCost.Text          = dr["o_financeCust"].ToString();
            finCost = Utils.StrToDecimal(dr["o_financeCust"].ToString(), 0);
            ddllockstatus.SelectedValue = dr["o_lockStatus"].ToString();
            labFinRemarks.Text          = dr["o_finRemarks"].ToString();
            txtFinRemark.Text           = dr["o_finRemarks"].ToString();
            labStatusTime.Text          = Utils.ObjectToStr(dr["o_statusTime"]) == "" ? "" : Utils.StrToDateTime(Utils.ObjectToStr(dr["o_statusTime"])).ToString("yyyy-MM-dd HH:mm:ss");

            #region 归属地
            string placeStr = dr["o_place"].ToString();
            if (!string.IsNullOrEmpty(placeStr))
            {
                Dictionary <string, string> areaDic      = new BLL.department().getAreaDict();
                Dictionary <string, string> orderAreaDic = new Dictionary <string, string>();
                string[] list = placeStr.Split(',');
                foreach (string item in list)
                {
                    if (areaDic.ContainsKey(item))
                    {
                        orderAreaDic.Add(item, areaDic[item]);
                    }
                }
                rptAreaList.DataSource = orderAreaDic;
                rptAreaList.DataBind();
            }
            #endregion

            #region 人员
            DataTable pdt = bll.GetPersonList(0, "op_oid='" + _oid + "'", "op_id asc").Tables[0];
            if (pdt != null && pdt.Rows.Count > 0)
            {
                rptEmployee1.DataSource = pdt.Select("op_type=2");
                rptEmployee1.DataBind();

                rptEmployee2.DataSource = pdt.Select("op_type=3");
                rptEmployee2.DataBind();

                rptEmployee3.DataSource = pdt.Select("op_type=4");
                rptEmployee3.DataBind();

                rptEmployee4.DataSource = pdt.Select("op_type=5");
                rptEmployee4.DataBind();

                liplace.Visible          = false;
                liemployee1.Visible      = false;
                liemployee2.Visible      = false;
                liemployee3.Visible      = false;
                liemployee4.Visible      = false;
                uploadDiv.Visible        = false;
                uploadDiv2.Visible       = false;
                btnSave.Visible          = false;
                btnDstatus.Visible       = false;
                btnFlag.Visible          = false;
                btnLockstatus.Visible    = false;
                btnUpdateCost.Visible    = false;
                btnUnBusinessPay.Visible = false;
                btnReceiptPay.Visible    = false;
                btnFinRemark.Visible     = false;
                //btnPay.Visible = false;
                btnInvoince.Visible = false;
                //btnExcelIn.Visible = false;
                btnSharing.Visible = false;
                trFile.Visible     = false;
                #region 根据当前登录账户显示不同按钮
                DataRow[] drs1       = pdt.Select("op_type=1 and op_number='" + manager.user_name + "'"); //业务员
                DataRow[] drs2       = pdt.Select("op_type=2 and op_number='" + manager.user_name + "'"); //业务报账人员
                DataRow[] drs3       = pdt.Select("op_type=3 and op_number='" + manager.user_name + "'"); //业务策划人员
                DataRow[] drs4       = pdt.Select("op_type=4 and op_number='" + manager.user_name + "'"); //业务执行人员
                DataRow[] drs6       = pdt.Select("op_type=5 and op_number='" + manager.user_name + "'"); //业务设计人员
                bool      showDetail = false;

                if (drs4.Length > 0)
                {
                    isExecutiver             = true;
                    showDetail               = true;
                    uploadDiv.Visible        = true;
                    btnUnBusinessPay.Visible = true;
                    btnReceiptPay.Visible    = true;
                    //btnPay.Visible = true;
                    btnInvoince.Visible = true;
                    //btnExcelIn.Visible = true;
                }
                if (drs3.Length > 0 || drs6.Length > 0)
                {
                    showDetail         = true;
                    uploadDiv.Visible  = true;
                    uploadDiv2.Visible = true;
                    btnDstatus.Visible = true;
                    trFile.Visible     = true;
                    if (drs3.Length > 0)
                    {
                        ddldstatus.SelectedValue = drs3[0]["op_dstatus"].ToString();
                    }
                    else if (drs6.Length > 0)
                    {
                        ddldstatus.SelectedValue = drs6[0]["op_dstatus"].ToString();
                    }
                }
                if (drs2.Length > 0)
                {
                    isExecutiver             = false;
                    showDetail               = true;
                    liplace.Visible          = true;
                    liemployee2.Visible      = true;
                    liemployee3.Visible      = true;
                    liemployee4.Visible      = true;
                    uploadDiv.Visible        = true;
                    uploadDiv2.Visible       = true;
                    btnUnBusinessPay.Visible = true;
                    btnReceiptPay.Visible    = true;
                    btnSave.Visible          = true;
                    //btnPay.Visible = true;
                    btnInvoince.Visible = true;
                    //btnExcelIn.Visible = true;
                    trFile.Visible = true;
                }
                if (drs1.Length > 0)
                {
                    isExecutiver             = false;
                    showDetail               = true;
                    liplace.Visible          = true;
                    liemployee1.Visible      = true;
                    liemployee2.Visible      = true;
                    liemployee3.Visible      = true;
                    liemployee4.Visible      = true;
                    uploadDiv.Visible        = true;
                    uploadDiv2.Visible       = true;
                    btnSave.Visible          = true;
                    btnUnBusinessPay.Visible = true;
                    btnReceiptPay.Visible    = true;
                    //btnPay.Visible = true;
                    btnInvoince.Visible = true;
                    //btnExcelIn.Visible = true;
                    trFile.Visible = true;
                }
                DataRow[] drs5 = pdt.Select("op_type=1");
                //判断是否含有查看本区域数据的权限
                if (new BLL.permission().checkHasPermission(manager, "0602") && (drs5[0]["op_area"].ToString() == manager.area || Utils.ObjectToStr(dr["o_place"]).IndexOf(manager.area) > -1))
                {
                    showDetail     = true;
                    trFile.Visible = true;
                }
                string groupArea = new BLL.department().getGroupArea();//总部

                //判断是否是本区域,且含有财务基本权限
                if ((drs5[0]["op_area"].ToString() == manager.area || groupArea == manager.area) && new BLL.permission().checkHasPermission(manager, "0401"))
                {
                    showDetail               = true;
                    trFile.Visible           = true;
                    btnUnBusinessPay.Visible = true;
                    btnReceiptPay.Visible    = true;
                    uploadDiv2.Visible       = true;
                    //btnPay.Visible = true;
                    btnInvoince.Visible = true;
                    //btnExcelIn.Visible = true;
                }
                //判断是否含有查看本区域审批权限
                if (drs5[0]["op_area"].ToString() == manager.area && new BLL.permission().checkHasPermission(manager, "0603"))
                {
                    trFile.Visible  = true;
                    showDetail      = true;
                    btnFlag.Visible = true;
                }
                //
                if (groupArea == manager.area)
                {
                    if (new BLL.permission().checkHasPermission(manager, "0401"))
                    {
                        showDetail     = true;
                        trFile.Visible = true;
                    }
                    if (new BLL.permission().checkHasPermission(manager, "0405"))
                    {
                        showDetail            = true;
                        btnLockstatus.Visible = true;
                        btnUpdateCost.Visible = true;
                        trFile.Visible        = true;
                    }
                }
                if (new BLL.permission().checkHasPermission(manager, "0401"))
                {
                    btnFinRemark.Visible = true;
                    if (!Utils.StrToBool(dr["o_lockStatus"].ToString(), false))
                    {
                        btnSharing.Visible = true;
                    }
                }
                //以上都没有权限的,不能查看订单详细
                if (!showDetail)
                {
                    string msgbox = "parent.jsdialog(\"错误提示\", \"您没有管理该页面的权限,请勿非法进入!\", \"back\")";
                    Response.Write("<script type=\"text/javascript\">" + msgbox + "</script>");
                    Response.End();
                }
                #endregion
            }
            #endregion

            if (dr["o_lockStatus"].ToString() == "1")
            {
                liplace.Visible          = false;
                liemployee1.Visible      = false;
                liemployee2.Visible      = false;
                liemployee3.Visible      = false;
                liemployee4.Visible      = false;
                uploadDiv.Visible        = false;
                uploadDiv2.Visible       = false;
                btnSave.Visible          = false;
                btnDstatus.Visible       = false;
                btnFlag.Visible          = false;
                btnUpdateCost.Visible    = false;
                btnUnBusinessPay.Visible = false;
                btnReceiptPay.Visible    = false;
                //btnPay.Visible = false;
                btnInvoince.Visible = true;
                //btnExcelIn.Visible = false;
            }

            #region 活动文件
            DataTable fdt = bll.GetFileList(0, "f_oid='" + _oid + "'", "f_addDate asc,f_id asc").Tables[0];
            if (fdt != null && fdt.Rows.Count > 0)
            {
                rptAlbumList.DataSource = fdt.Select("f_type=1");
                rptAlbumList.DataBind();

                rptAlbumList2.DataSource = fdt.Select("f_type=2");
                rptAlbumList2.DataBind();
            }
            #endregion

            string sqlwhere = "";
            #region 执行备用金借款明细
            if (isExecutiver)
            {
                sqlwhere = " and uba_PersonNum='" + manager.user_name + "'";
            }
            DataSet unBusinessData = new BLL.unBusinessApply().GetList(0, "uba_oid='" + _oid + "' " + sqlwhere + "", "uba_addDate desc,uba_id desc");
            if (unBusinessData != null && unBusinessData.Tables[0].Rows.Count > 0)
            {
                rptunBusinessList.DataSource = unBusinessData;
                rptunBusinessList.DataBind();
            }
            #endregion

            #region 应收付
            DataTable natureData = new BLL.finance().getNature(_oid, isExecutiver ? manager.user_name : "");
            if (natureData != null && natureData.Rows.Count > 0)
            {
                rptNature.DataSource = natureData;
                rptNature.DataBind();
            }

            #endregion

            #region 发票
            if (isExecutiver)
            {
                sqlwhere = " and inv_personNum='" + manager.user_name + "'";
            }
            DataTable invoiceData = new BLL.invoices().GetList(0, "inv_oid='" + _oid + "' " + sqlwhere + "", "inv_addDate desc,inv_id desc").Tables[0];
            if (invoiceData != null && invoiceData.Rows.Count > 0)
            {
                foreach (DataRow inv in invoiceData.Rows)
                {
                    if (inv["inv_flag1"].ToString() != "1" && inv["inv_flag2"].ToString() != "1" && inv["inv_flag3"].ToString() != "1")
                    {
                        requestMoney += Utils.StrToDecimal(inv["inv_money"].ToString(), 0);
                    }
                    if (Utils.StrToBool(inv["inv_isConfirm"].ToString(), false))
                    {
                        confirmMoney += Utils.StrToDecimal(inv["inv_money"].ToString(), 0);
                    }
                }
                rptInvoiceList.DataSource = invoiceData;
                rptInvoiceList.DataBind();
            }
            #endregion

            #region 已收付款
            if (isExecutiver)
            {
                sqlwhere = " and rpd_personNum='" + manager.user_name + "'";
            }
            DataTable rpData = new BLL.ReceiptPayDetail().GetList(0, "rpd_oid='" + _oid + "'", "rpd_type desc,rpd_adddate desc,rpd_id desc").Tables[0];
            if (rpData != null && rpData.Rows.Count > 0)
            {
                rptList.DataSource = rpData;
                rptList.DataBind();
            }
            #endregion

            #region 结算汇总
            if (!isExecutiver)//执行人员不可查看
            {
                DataTable collectData = bll.getOrderCollect(_oid);
                if (collectData != null && collectData.Rows.Count > 0)
                {
                    foreach (DataRow inv in collectData.Rows)
                    {
                        finProfit += Utils.StrToDecimal(inv["profit"].ToString(), 0);
                        if (inv["fin_type"].ToString() == "True")
                        {
                            fin1 += Utils.StrToDecimal(inv["finMoney"].ToString(), 0);
                        }
                        else
                        {
                            fin0 += Utils.StrToDecimal(inv["finMoney"].ToString(), 0);
                        }
                    }

                    rptCollect.DataSource = collectData;
                    rptCollect.DataBind();
                }
            }
            #endregion
        }
Example #6
0
        private void RptBind()
        {
            string sql = " Status >= 2 ";

            if (!string.IsNullOrEmpty(_beginTime))
            {
                sql += " AND FactBackTime >= '" + _beginTime + "' ";
                txtBeginTime.Text = _beginTime;
            }
            else
            {
                sql += " AND FactBackTime >= '" + DateTime.Now.AddMonths(-1) + "' ";
                txtBeginTime.Text = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            }
            if (!string.IsNullOrEmpty(_endTime))
            {
                sql            += " AND FactBackTime <= '" + _endTime + "' ";
                txtEndTime.Text = _endTime;
            }
            else
            {
                sql            += " AND FactBackTime <= '" + DateTime.Now + "' ";
                txtEndTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            }
            string ids = string.Empty;

            BLL.TransportOrder bll  = new BLL.TransportOrder();
            DataSet            tods = bll.GetTotalList(sql);

            if (tods != null && tods.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in tods.Tables[0].Rows)
                {
                    ids += dr["Id"].ToString() + ",";
                    totalFactRepayment += Utils.StrToDecimal(dr["FactRepayment"].ToString(), 0.00M);
                    totalCarriage      += Utils.StrToDecimal(dr["FactCarriage"].ToString(), 0.00M);
                    totalAdvance       += Utils.StrToDecimal(dr["Advance"].ToString(), 0.00M);
                }
                if (ids.EndsWith(","))
                {
                    ids = ids.TrimEnd(',');
                }
            }
            if (!string.IsNullOrEmpty(ids))
            {
                BLL.Order itemBll = new BLL.Order();
                DataSet   itemds  = itemBll.GetList(" TransportOrderId IN (" + ids + ") ");
                if (itemds != null && itemds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in itemds.Tables[0].Rows)
                    {
                        totalIncome += Utils.StrToDecimal(dr["Freight"].ToString(), 0.00M);
                    }
                }

                BLL.Consumption cBll = new BLL.Consumption();
                DataSet         cds  = cBll.GetSumList(" TransportOrderId IN (" + ids + ") ");
                if (cds != null && cds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in cds.Tables[0].Rows)
                    {
                        totalCostItem += Utils.StrToDecimal(dr["TotalMoney"].ToString(), 0.00M);
                        costItem      += "<tr><td width=\"20%\" style=\"text-align:right\">" + dr["Name"].ToString() + "&nbsp;:&nbsp;&nbsp;</td>";
                        costItem      += "<td>¥" + string.Format("{0:N2}", dr["TotalMoney"]) + "</td></tr>";
                    }
                }
            }

            totalGain = totalIncome + totalFactRepayment - totalCarriage - totalAdvance - totalCostItem;
        }
Example #7
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            //if (_goods > 0)
            //{
            //    ddlGoods.SelectedValue = _goods.ToString();
            //}
            //if (_customer1 > 0)
            //{
            //    ddlCustomer1.SelectedValue = _customer1.ToString();
            //}
            //if (_customer2 > 0)
            //{
            //    ddlCustomer2.SelectedValue = _customer2.ToString();
            //}
            //if (!string.IsNullOrEmpty(_beginTime))
            //{
            //    txtBeginTime.Text = _beginTime;
            //}
            //if (!string.IsNullOrEmpty(_endTime))
            //{
            //    txtEndTime.Text = _endTime;
            //}
            //this.txtKeywords.Text = this.keywords;
            BLL.Order bll = new BLL.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("dialog_order_list.aspx", "goods={0}&customer1={1}&customer2={2}&beginTime={3}&endTime={4}&keywords={5}&page={6}&transportOrderId=" + this.transportOrderId + "",
                _goods.ToString(), _customer1.ToString(), _customer2.ToString(), _beginTime, _endTime, this.keywords, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Example #8
0
        private void RptBind()
        {
            string sql = " Status >= 2 ";
            if (!string.IsNullOrEmpty(_beginTime))
            {
                sql += " AND FactBackTime >= '" + _beginTime + "' ";
                txtBeginTime.Text = _beginTime;
            }
            else
            {
                sql += " AND FactBackTime >= '" + DateTime.Now.AddMonths(-1) + "' ";
                txtBeginTime.Text = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            }
            if (!string.IsNullOrEmpty(_endTime))
            {
                sql += " AND FactBackTime <= '" + _endTime + "' ";
                txtEndTime.Text = _endTime;
            }
            else
            {
                sql += " AND FactBackTime <= '" + DateTime.Now + "' ";
                txtEndTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            }
            string ids = string.Empty;
            BLL.TransportOrder bll = new BLL.TransportOrder();
            DataSet tods = bll.GetTotalList(sql);
            if (tods != null && tods.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in tods.Tables[0].Rows)
                {
                    ids += dr["Id"].ToString() + ",";
                    totalFactRepayment += Utils.StrToDecimal(dr["FactRepayment"].ToString(), 0.00M);
                    totalCarriage += Utils.StrToDecimal(dr["FactCarriage"].ToString(), 0.00M);
                    totalAdvance += Utils.StrToDecimal(dr["Advance"].ToString(), 0.00M);
                }
                if (ids.EndsWith(","))
                {
                    ids = ids.TrimEnd(',');
                }
            }
            if (!string.IsNullOrEmpty(ids))
            {
                BLL.Order itemBll = new BLL.Order();
                DataSet itemds = itemBll.GetList(" TransportOrderId IN (" + ids + ") ");
                if (itemds != null && itemds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in itemds.Tables[0].Rows)
                    {
                        totalIncome += Utils.StrToDecimal(dr["Freight"].ToString(), 0.00M);
                    }
                }

                BLL.Consumption cBll = new BLL.Consumption();
                DataSet cds = cBll.GetSumList(" TransportOrderId IN (" + ids + ") ");
                if (cds != null && cds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in cds.Tables[0].Rows)
                    {
                        totalCostItem += Utils.StrToDecimal(dr["TotalMoney"].ToString(), 0.00M);
                        costItem += "<tr><td width=\"20%\" style=\"text-align:right\">"+dr["Name"].ToString()+"&nbsp;:&nbsp;&nbsp;</td>";
                        costItem += "<td>¥" + string.Format("{0:N2}", dr["TotalMoney"]) + "</td></tr>";
                    }
                }
            }

            totalGain = totalIncome + totalFactRepayment - totalCarriage - totalAdvance - totalCostItem;
        }
Example #9
0
        private void TreeBind(string strWhere)
        {
            BLL.Motorcade bll = new BLL.Motorcade();
            DataTable dt = bll.GetList(0, strWhere, "Id desc").Tables[0];

            ddlMotorcade.Items.Clear();
            ddlMotorcade.Items.Add(new ListItem("请选择车队", ""));
            foreach (DataRow dr in dt.Rows)
            {
                this.ddlMotorcade.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString()));
            }
            ddlMotorcade.SelectedIndex = 0;

            string motorcadeName = ddlMotorcade.SelectedValue;
            BLL.Vehicle vehicleBll = new BLL.Vehicle();
            ddlCarNumber.Items.Clear();
            ddlCarNumber.Items.Add(new ListItem("请选择车辆", ""));
            if (!string.IsNullOrEmpty(motorcadeName))
            {
                DataTable vehicledt = vehicleBll.GetList(0, " MotorcadeName = '" + motorcadeName + "' ", "Id desc").Tables[0];

                foreach (DataRow dr in vehicledt.Rows)
                {
                    this.ddlCarNumber.Items.Add(new ListItem(dr["CarCode"].ToString(), dr["CarCode"].ToString()));
                }
            }
            else
            {
                DataTable vehicledt = vehicleBll.GetList(0, "", "Id desc").Tables[0];

                foreach (DataRow dr in vehicledt.Rows)
                {
                    this.ddlCarNumber.Items.Add(new ListItem(dr["CarCode"].ToString(), dr["CarCode"].ToString()));
                }
            }

            BLL.Order orderBll = new BLL.Order();
            this.rptList.DataSource = orderBll.GetList(" Quantity > DispatchedCount or (IsCharteredCar = 1 and DispatchedCount = 0.00)");
            this.rptList.DataBind();
        }