示例#1
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("costItem_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.CostItem bll = new BLL.CostItem();
            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)
                {
                    if (bll.Delete(id))
                    {
                        sucCount += 1;
                    }
                    else
                    {
                        errorCount += 1;
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除出车费用项成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("costItem_list.aspx", "keywords={0}", this.keywords), "Success");
        }
示例#2
0
        private void ShowInfo(int _id)
        {
            BLL.CostItem   bll   = new BLL.CostItem();
            Model.CostItem model = bll.GetModel(_id);

            txtName.Text     = model.Name;
            txtSortCode.Text = model.SortCode.ToString();
        }
示例#3
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            labFactDispatchTime.Text = model.FactDispatchTime.Value.ToString("yyyy-MM-dd");
            txtFactBackTime.Text     = DateTime.Now.ToString("yyyy-MM-dd");
            labMotorcade.Text        = model.MotorcadeName;
            labCarNumber.Text        = model.CarNumber;
            labDriver.Text           = model.Driver;
            labAdvance.Text          = model.Advance.ToString();
            labPayee.Text            = model.Driver;
            txtRepayment.Text        = model.Advance.ToString();
            txtFactRepayment.Text    = "0.00";

            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
            DataTable dt = itemBll.GetList(" TransportOrderId = " + model.Id + "").Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"transportOrderItemId\" value=\"" + dr["Id"].ToString() + "\"/></td>";
                transportOrderItems += "<td align=\"left\">" + dr["OrderCode"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\"><select name='roundStatus'>";
                transportOrderItems += "<option value='往'>往</option>";
                transportOrderItems += "<option value='返'>返</option>";
                transportOrderItems += "<option value='往返'>往返</option>";
                transportOrderItems += "</select></td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Goods"].ToString() + "</td>";
                transportOrderItems += "<td width=\"9%\">" + dr["Unit"].ToString() + "</td>";
                transportOrderItems += "<td width=\"6%\"><input type=\"text\" name=\"factDispatchCount\" class=\"input small\" value=\"" + dr["FactDispatchCount"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"5%\"><input type=\"text\" name=\"factReceivedCount\" class=\"input small\" value=\"" + dr["FactReceivedCount"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["UnitPrice"].ToString()) + "</td>";
                transportOrderItems += "<td width=\"5%\">¥<input type=\"text\" name=\"totalPrice\" value=\"" + dr["TotalPrice"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "</tr>";
            }

            BLL.CostItem costItemBll = new BLL.CostItem();
            DataTable    costItemDT  = costItemBll.GetAllList().Tables[0];

            foreach (DataRow dr in costItemDT.Rows)
            {
                consumptions += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                consumptions += "<td width=\"5%\"><input type=\"hidden\" name=\"costItemName\" value=\"" + dr["Name"].ToString() + "\"/></td>";
                consumptions += "<td width=\"5%\">" + dr["Name"].ToString() + "</td>";
                consumptions += "<td width=\"50%\">¥<input type=\"text\" name=\"money\" class=\"input small\" value=\"0.00\"/></td>";
                consumptions += "</tr>";
            }
        }
示例#4
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page        = DTRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            BLL.CostItem bll = new BLL.CostItem();
            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("costItem_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
示例#5
0
        private bool DoAdd()
        {
            Model.CostItem model = new Model.CostItem();
            BLL.CostItem bll = new BLL.CostItem();

            model.Name = txtName.Text.Trim();
            model.SortCode = Utils.StrToInt(txtSortCode.Text.Trim(), 0);

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加出车费用项:" + model.Name); //记录日志
                return true;
            }
            return false;
        }
示例#6
0
        private bool DoAdd()
        {
            Model.CostItem model = new Model.CostItem();
            BLL.CostItem   bll   = new BLL.CostItem();

            model.Name     = txtName.Text.Trim();
            model.SortCode = Utils.StrToInt(txtSortCode.Text.Trim(), 0);

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加出车费用项:" + model.Name); //记录日志
                return(true);
            }
            return(false);
        }
示例#7
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            txtFactArriveDate.Text    = model.FactArriveDate.Value.ToString("yyyy-MM-dd");
            txtFactBackTime.Text      = model.BackTime.Value.ToString("yyyy-MM-dd");
            txtFactDispatchCount.Text = model.FactDispatchCount.ToString();
            txtFactWeight.Text        = model.FactWeight.ToString();
            txtReceivedWeight.Text    = model.FactWeight.ToString();
            txtUnloadingWeight.Text   = model.FactWeight.ToString();
            txtFactCarriage.Text      = model.FactCarriage.ToString();
            txtRepayment.Text         = model.Advance.ToString();
            txtFactRepayment.Text     = "0.00";

            BLL.Order itemBll = new BLL.Order();
            DataTable dt      = itemBll.GetPrintList(0, " and A.TransportOrderId = " + model.Id + "", " order by A.Id desc").Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"OrderId\" value=\"" + dr["Id"].ToString() + "\"/></td>";
                transportOrderItems += "<td align=\"left\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"13%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"13%\">" + dr["Receiver"].ToString() + "</td>";
                transportOrderItems += "<td width=\"12%\">" + dr["GoodsName"].ToString() + "</td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"UnitPrice\" class=\"input small\" value=\"" + dr["UnitPrice"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\"><input type=\"text\" name=\"Weight\" class=\"input small\" value=\"" + dr["Weight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"Freight\" value=\"" + dr["Freight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"PaidFreight\" value=\"" + dr["PaidFreight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"UnpaidFreight\" value=\"" + dr["UnpaidFreight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "</tr>";
            }

            BLL.CostItem costItemBll = new BLL.CostItem();
            DataTable    costItemDT  = costItemBll.GetAllList().Tables[0];

            foreach (DataRow dr in costItemDT.Rows)
            {
                consumptions += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                consumptions += "<td width=\"5%\"><input type=\"hidden\" name=\"costItemName\" value=\"" + dr["Name"].ToString() + "\"/></td>";
                consumptions += "<td width=\"5%\">" + dr["Name"].ToString() + "</td>";
                consumptions += "<td width=\"50%\">¥<input type=\"text\" name=\"money\" class=\"input small\" value=\"0.00\"/></td>";
                consumptions += "</tr>";
            }
        }
示例#8
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.CostItem   bll   = new BLL.CostItem();
            Model.CostItem model = bll.GetModel(_id);

            model.Name     = txtName.Text.Trim();
            model.SortCode = Utils.StrToInt(txtSortCode.Text.Trim(), 0);

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改出车费用项:" + model.Name); //记录日志
                result = true;
            }

            return(result);
        }
示例#9
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            labFactDispatchTime.Text = model.FactDispatchTime.Value.ToString("yyyy-MM-dd");
            txtFactBackTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            labMotorcade.Text = model.MotorcadeName;
            labCarNumber.Text = model.CarNumber;
            labDriver.Text = model.Driver;
            labAdvance.Text = model.Advance.ToString();
            labPayee.Text = model.Driver;
            txtRepayment.Text = model.Advance.ToString();
            txtFactRepayment.Text = "0.00";

            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
            DataTable dt = itemBll.GetList(" TransportOrderId = " + model.Id + "").Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"transportOrderItemId\" value=\"" + dr["Id"].ToString() + "\"/></td>";
                transportOrderItems += "<td align=\"left\">" + dr["OrderCode"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\"><select name='roundStatus'>";
                transportOrderItems += "<option value='往'>往</option>";
                transportOrderItems += "<option value='返'>返</option>";
                transportOrderItems += "<option value='往返'>往返</option>";
                transportOrderItems += "</select></td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Goods"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"9%\">" + dr["Unit"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"6%\"><input type=\"text\" name=\"factDispatchCount\" class=\"input small\" value=\"" + dr["FactDispatchCount"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"5%\"><input type=\"text\" name=\"factReceivedCount\" class=\"input small\" value=\"" + dr["FactReceivedCount"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}",dr["UnitPrice"].ToString())+ "</td>";
                transportOrderItems += "<td width=\"5%\">¥<input type=\"text\" name=\"totalPrice\" value=\"" + dr["TotalPrice"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "</tr>";
            }

            BLL.CostItem costItemBll = new BLL.CostItem();
            DataTable costItemDT = costItemBll.GetAllList().Tables[0];
            foreach (DataRow dr in costItemDT.Rows)
            {
                consumptions += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                consumptions += "<td width=\"5%\"><input type=\"hidden\" name=\"costItemName\" value=\"" + dr["Name"].ToString() + "\"/></td>";
                consumptions += "<td width=\"5%\">" + dr["Name"].ToString() + "</td>";
                consumptions += "<td width=\"50%\">¥<input type=\"text\" name=\"money\" class=\"input small\" value=\"0.00\"/></td>";
                consumptions += "</tr>";
            }
        }
示例#10
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.CostItem bll = new BLL.CostItem();
            Model.CostItem model = bll.GetModel(_id);

            model.Name = txtName.Text.Trim();
            model.SortCode = Utils.StrToInt(txtSortCode.Text.Trim(), 0);

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改出车费用项:" + model.Name); //记录日志
                result = true;
            }

            return result;
        }
示例#11
0
        private void ShowInfo(int _id)
        {
            BLL.CostItem bll = new BLL.CostItem();
            Model.CostItem model = bll.GetModel(_id);

            txtName.Text = model.Name;
            txtSortCode.Text = model.SortCode.ToString();
        }
示例#12
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            txtFactArriveDate.Text = model.FactArriveDate.Value.ToString("yyyy-MM-dd");
            txtFactBackTime.Text = model.BackTime.Value.ToString("yyyy-MM-dd");
            txtFactDispatchCount.Text = model.FactDispatchCount.ToString();
            txtFactWeight.Text = model.FactWeight.ToString();
            txtReceivedWeight.Text = model.FactWeight.ToString();
            txtUnloadingWeight.Text = model.FactWeight.ToString();
            txtFactCarriage.Text = model.FactCarriage.ToString();
            txtRepayment.Text = model.Advance.ToString();
            txtFactRepayment.Text = "0.00";

            BLL.Order itemBll = new BLL.Order();
            DataTable dt = itemBll.GetPrintList(0, " and A.TransportOrderId = " + model.Id + "", " order by A.Id desc").Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"OrderId\" value=\"" + dr["Id"].ToString() + "\"/></td>";
                transportOrderItems += "<td align=\"left\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"13%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"13%\">" + dr["Receiver"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"12%\">" + dr["GoodsName"].ToString() + "</td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"UnitPrice\" class=\"input small\" value=\"" + dr["UnitPrice"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\"><input type=\"text\" name=\"Weight\" class=\"input small\" value=\"" + dr["Weight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"Freight\" value=\"" + dr["Freight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"PaidFreight\" value=\"" + dr["PaidFreight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"UnpaidFreight\" value=\"" + dr["UnpaidFreight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "</tr>";
            }

            BLL.CostItem costItemBll = new BLL.CostItem();
            DataTable costItemDT = costItemBll.GetAllList().Tables[0];
            foreach (DataRow dr in costItemDT.Rows)
            {
                consumptions += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                consumptions += "<td width=\"5%\"><input type=\"hidden\" name=\"costItemName\" value=\"" + dr["Name"].ToString() + "\"/></td>";
                consumptions += "<td width=\"5%\">" + dr["Name"].ToString() + "</td>";
                consumptions += "<td width=\"50%\">¥<input type=\"text\" name=\"money\" class=\"input small\" value=\"0.00\"/></td>";
                consumptions += "</tr>";
            }
        }