private void RptBind(string _strWhere, string _goodsby) { this.page = DTRequest.GetQueryInt("page", 1); if (this.customer_id > 0) { this.ddlCustomer.SelectedValue = this.customer_id.ToString(); } if (this.storein_order_id > 0) { this.ddlStoreInOrder.SelectedValue = this.storein_order_id.ToString(); } txtKeyWord.Text = this.keyword; txtBeginTime.Text = this.beginTime; txtEndTime.Text = this.endTime; BLL.ReceivedMoney bll = new BLL.ReceivedMoney(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _goodsby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("storein_received_list.aspx", "customer_id={0}&storein_order_id={1}&keyword={2}&beginTime={3}&endTime={4}&page={5}", this.customer_id.ToString(), this.storein_order_id.ToString(), this.keyword.ToString(), this.beginTime.ToString(), this.endTime, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("received_money", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.ReceivedMoney bll = new BLL.ReceivedMoney(); 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("received_money_list.aspx", "customer_id={0}&storein_order_id={1}&beginTime={2}&endTime={3}", this.customer_id.ToString(), this.storein_order_id.ToString(), this.beginTime.ToString(), this.endTime)); }
private bool DoAdd() { bool result = false; if (string.IsNullOrWhiteSpace(txtReceivedTime.Text)) { JscriptMsg("收款时间不能为空!", ""); return(false); } string[] storeInOrderValues = ddlSotreInOrder.SelectedValue.Split('|'); Model.ReceivedMoney model = new Model.ReceivedMoney(); BLL.ReceivedMoney bll = new BLL.ReceivedMoney(); model.Name = txtName.Text; model.CustomerId = int.Parse(ddlCustomer.SelectedValue); model.StoreInOrderId = int.Parse(storeInOrderValues[0]); model.BeginChargingTime = DateTime.Parse(hidReceivedBeginTime.Value); model.EndChargingTime = DateTime.Parse(hidReceivedEndTime.Value); model.ReceivedTime = DateTime.Parse(txtReceivedTime.Text); model.ChargingCount = decimal.Parse(txtChargingCount.Text); model.TotalPrice = decimal.Parse(txtTotalMoney.Text); model.InvoicedPrice = decimal.Parse(txtInvoiceMoney.Text); model.HasBeenInvoiced = rblHasBeenInvoiced.Checked; if (!string.IsNullOrWhiteSpace(txtReceivedTime.Text)) { model.InvoicedTime = DateTime.Parse(txtReceivedTime.Text); } model.Admin = txtAdmin.Text; model.InvoicedOperator = txtInvoicedOperator.Text; model.UnitPriceDetails = txtUnitPriceDetails.Text; model.Remark = txtRemark.Text; model.Status = 0; model.CreateTime = DateTime.Now; if (bll.Add(model)) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加收款记录:" + model.Id); //记录日志 result = true; } return(result); }
private void ShowInfo(int _id) { BLL.ReceivedMoney bll = new BLL.ReceivedMoney(); Model.ReceivedMoney model = bll.GetModel(_id); txtName.Text = model.Name; ddlCustomer.SelectedValue = model.CustomerId.ToString(); StoreInOrderBind(model.CustomerId.ToString()); ddlSotreInOrder.SelectedValue = model.StoreInOrderId.ToString() + "|" + model.ReceivedTime.ToString() + "|" + model.ChargingCount.ToString(); hidReceivedBeginTime.Value = model.BeginChargingTime.ToString(); hidReceivedEndTime.Value = model.EndChargingTime.ToString(); txtReceivedTime.Text = model.ReceivedTime.ToString("yyyy-MM-dd"); txtChargingCount.Text = model.ChargingCount.ToString(); txtTotalMoney.Text = model.TotalPrice.ToString(); txtInvoiceMoney.Text = model.InvoicedPrice.ToString(); txtAdmin.Text = model.Admin; txtRemark.Text = model.Remark; rblHasBeenInvoiced.Checked = model.HasBeenInvoiced; txtInvoicedTime.Text = model.InvoicedTime.HasValue ? model.InvoicedTime.Value.ToString("yyyy-MM-dd") : ""; txtInvoicedOperator.Text = model.InvoicedOperator; txtUnitPriceDetails.Text = model.UnitPriceDetails; }
private void RptBind(string _strWhere, string _goodsby) { this.page = DTRequest.GetQueryInt("page", 1); if (this.customer_id > 0) { ddlCustomer.SelectedValue = customer_id.ToString(); } if (this.storein_order_id > 0) { ddlStoreInOrder.SelectedValue = storein_order_id.ToString(); } txtBeginTime.Text = this.beginTime; txtEndTime.Text = this.endTime; txtKeyWord.Text = this.keywords; BLL.ReceivedMoney bll = new BLL.ReceivedMoney(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _goodsby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("received_money_list.aspx", "customer_id={0}&storein_order_id={1}&vehicle_id={2}&beginTime={3}&endTime={4}&keywords={5}&page={6}", this.customer_id.ToString(), this.storein_order_id.ToString(), this.vehicle_id.ToString(), this.beginTime.ToString(), this.endTime, this.keywords.ToString(), "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void doInvoiced(HttpContext context) { int id = DTRequest.GetFormInt("id"); string invoicedTime = DTRequest.GetFormString("invoicedTime"); string invoicedOperator = DTRequest.GetFormString("invoicedOperator"); if (id < 1) { context.Response.Write("{\"status\": 0, \"msg\": \"ID不能为空!\"}"); return; } DateTime d; if (!DateTime.TryParse(invoicedTime, out d)) { context.Response.Write("{\"status\": 0, \"msg\": \"开票时间不是时间类型!\"}"); return; } if (string.IsNullOrWhiteSpace(invoicedOperator)) { context.Response.Write("{\"status\": 0, \"msg\": \"开票人不能为空!\"}"); return; } //开始发送 bool result = new BLL.ReceivedMoney().UpdateField(id, "InvoicedTime = '" + d + "', InvoicedOperator = '" + invoicedOperator + "', HasBeenInvoiced = 1") > 0; if (result) { context.Response.Write("{\"status\": 1, \"msg\": \"执行成功\"}"); return; } context.Response.Write("{\"status\": 0, \"msg\": \"执行失败\"}"); return; }
private bool DoAdd() { bool result = false; if (string.IsNullOrWhiteSpace(txtReceivedTime.Text)) { JscriptMsg("收款时间不能为空!", ""); return false; } string[] storeInOrderValues = ddlSotreInOrder.SelectedValue.Split('|'); Model.ReceivedMoney model = new Model.ReceivedMoney(); BLL.ReceivedMoney bll = new BLL.ReceivedMoney(); model.Name = txtName.Text; model.CustomerId = int.Parse(ddlCustomer.SelectedValue); model.StoreInOrderId = int.Parse(storeInOrderValues[0]); model.BeginChargingTime = DateTime.Parse(hidReceivedBeginTime.Value); model.EndChargingTime = DateTime.Parse(hidReceivedEndTime.Value); model.ReceivedTime = DateTime.Parse(txtReceivedTime.Text); model.ChargingCount = decimal.Parse(txtChargingCount.Text); model.TotalPrice = decimal.Parse(txtTotalMoney.Text); model.InvoicedPrice = decimal.Parse(txtInvoiceMoney.Text); model.HasBeenInvoiced = rblHasBeenInvoiced.Checked; if (!string.IsNullOrWhiteSpace(txtReceivedTime.Text)) { model.InvoicedTime = DateTime.Parse(txtReceivedTime.Text); } model.Admin = txtAdmin.Text; model.InvoicedOperator = txtInvoicedOperator.Text; model.UnitPriceDetails = txtUnitPriceDetails.Text; model.Remark = txtRemark.Text; model.Status = 0; model.CreateTime = DateTime.Now; if (bll.Add(model)) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加收款记录:" + model.Id); //记录日志 result = true; } return result; }
private void ShowInfo(int _id) { BLL.ReceivedMoney bll = new BLL.ReceivedMoney(); model = bll.GetModel(_id); }