//添加详细信息 private void addcombank() { string policyList = this.HidPolicy.Value; if (policyList != "") { string[] row = null; string[] cell = null; EtNet_Models.To_InvoiceDetial invoiceDetial = null; if (policyList.IndexOf(',') >= 0) { row = policyList.Split(','); } else { row = new string[1] { policyList }; } for (int i = 0; i < row.Length; i++) { invoiceDetial = new To_InvoiceDetial(); cell = row[i].Split('|'); invoiceDetial.PolicyID = cell[0]; invoiceDetial.CusName = cell[1]; invoiceDetial.Cost = float.Parse(cell[2]); invoiceDetial.DetialReamrk = ""; invoiceDetial.InvoiceID = To_InvoiceManager.getTo_InvoiceLastONE().Id; To_InvoiceDetialManager.addTo_InvoiceDetial(invoiceDetial); } } }
protected void ibtnDeleteAll_Click(object sender, ImageClickEventArgs e) { string delId = ""; //先遍历取得选中项 for (int i = 0; i < this.rpInvoice.Items.Count; i++) { CheckBox cbx = (CheckBox)(rpInvoice.Items[i].FindControl("cbx")); Label lbl = (Label)rpInvoice.Items[i].FindControl("lbl"); if (cbx != null || cbx.Text != "") { if (cbx.Checked) { delId += lbl.Text + ","; } } } //去掉最后一个, delId = (delId + ")").Replace(",)", ""); IList check = delId.Split(','); for (int i = 0; i < check.Count; i++) { To_Invoice to_Invoice = To_InvoiceManager.getTo_InvoiceById(Convert.ToInt32(check[i])); if (to_Invoice != null) { To_InvoiceManager.deleteTo_Invoice(Convert.ToInt32(check[i])); } } dataBind(); }
//添加 private void addinvoice() { LoginInfo login = (EtNet_Models.LoginInfo)Session["login"]; To_Invoice invoice = new To_Invoice(); //创建 invoice.InvoiceCDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); invoice.InvoiceCDepartment = DepartmentInfoManager.getDepartmentInfoById(login.Departid).Departid; invoice.InvoiceCMan = login.Id; //发票 invoice.InvoiceDate = DateTime.Parse(this.txtInvoiceDate.Value.ToString()); invoice.InvoiceID = this.txtInvoiceID.Value.ToString(); invoice.InvoiceUnit = this.txtUnit.Value.ToString(); invoice.Remark = this.txtRemark.Text.ToString(); invoice.Selasmane = Convert.ToInt32(this.HidSalesman.Value.ToString()); invoice.Department = this.txtDepart.Value.ToString(); invoice.Sum = float.Parse(this.txtSum.Value); invoice.InvoiceType = this.ddlType.SelectedItem.Text.ToString(); invoice.Upfile = ""; int count = To_InvoiceManager.addTo_Invoice(invoice); if (count > 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加成功!');location.href='../Invoice/InvoiceList.aspx'", true); adddetial(); } }
private void getType() { IList <To_Invoice> com = To_InvoiceManager.getTo_InvoiceAll(); this.type.DataSource = com; this.type.DataBind(); }
protected void rpInvoice_ItemCommand(object source, RepeaterCommandEventArgs e) { string id = e.CommandArgument.ToString(); //参数数组,0:单据ID,1:是否确认 string[] cmdArgs = e.CommandArgument.ToString().Split(','); //表示单据是否已确认 bool confirmReceipt = false; if (cmdArgs.Length > 1) { confirmReceipt = cmdArgs[1] == "1"; } string msg = ""; switch (e.CommandName) { case "Delete": if (confirmReceipt) { msg = "已确认发票不能删除"; break; } To_InvoiceManager.deleteTo_Invoice(Convert.ToInt32(cmdArgs[0])); bindDatasource(); break; case "Update": if (confirmReceipt) { msg = "已确认发票不能修改"; break; } Response.Redirect("UpdateInvoice.aspx?id=" + cmdArgs[0]); break; case "Detial": Response.Redirect("InvoiceInfo.aspx?id=" + cmdArgs[0]); break; case "CANCEL": To_InvoiceManager.CancelIsSure(Convert.ToInt32(cmdArgs[0])); bindDatasource(); break; default: break; } if (msg != string.Empty) { ClientScript.RegisterClientScriptBlock(this.GetType(), "page", string.Format("alert('{0}');", msg), true); } }
protected void rpInvoice_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { int id = Convert.ToInt32(e.CommandArgument); int count = To_InvoiceManager.deleteTo_Invoice(id); if (count <= 0) { ClientScript.RegisterClientScriptBlock(this.GetType(), "page", "alert('删除失败')", true); return; } } dataBind(); }
private void binddata() { string id = Request.QueryString["id"].ToString(); To_Invoice invoice = To_InvoiceManager.getTo_InvoiceById(Convert.ToInt32(id)); this.lblInvoiceID.Text = invoice.InvoiceID.ToString(); this.lblInvoiceDate.Text = invoice.InvoiceDate.ToString("yyyy-MM-dd"); this.lblInvoiceDepart.Text = invoice.Department.ToString(); this.lblInvoiceRemark.Text = invoice.Remark.ToString(); this.lblInvoiceUnit.Text = invoice.InvoiceUnit.ToString(); this.lblSalesman.Text = LoginInfoManager.getLoginInfoById(invoice.Selasmane).Cname.ToString(); this.lblCost.Text = invoice.Sum.ToString() + ".00"; this.lblCDate.Text = invoice.InvoiceCDate.ToString("yyyy-MM-dd"); this.lblCDepart.Text = DepartmentInfoManager.getDepartmentInfoById(invoice.InvoiceCDepartment).Departcname.ToString(); this.lblCMan.Text = LoginInfoManager.getLoginInfoById(invoice.InvoiceCMan).Cname.ToString(); this.lblInvoiceType.Text = invoice.InvoiceType.ToString(); lblState.Text = invoice.IsSure == 1 ? "已确认" : "<font color='red'>未确认</font>"; rpBind(invoice.Id.ToString()); }
private void addinvoice() { int id = Convert.ToInt32(this.txtInvoiceID.Value.ToString()); int idsum = To_InvoiceManager.getInvoiceById(id); if (idsum == 0) { LoginInfo login = (EtNet_Models.LoginInfo)Session["login"]; To_Invoice invoice = new To_Invoice(); //创建 invoice.InvoiceCDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); invoice.InvoiceCDepartment = DepartmentInfoManager.getDepartmentInfoById(login.Departid).Departid; invoice.InvoiceCMan = login.Id; //发票 invoice.InvoiceDate = DateTime.Parse(this.txtInvoiceDate.Value.ToString()); invoice.InvoiceID = this.txtInvoiceID.Value.ToString(); invoice.InvoiceID = this.txtInvoiceID.Value.ToString(); invoice.InvoiceUnit = this.txtUnit.Value.ToString(); invoice.Remark = this.txtRemark.Value.ToString(); invoice.Selasmane = Convert.ToInt32(this.HidSalesman.Value.ToString()); invoice.Department = this.txtDepart.Value.ToString(); invoice.Sum = float.Parse(this.txtSum.Value); invoice.InvoiceType = this.ddlType.SelectedItem.Text.ToString(); invoice.Upfile = ""; invoice.IsSure = this.ChkConfirm.Checked ? 1 : 0; int count = To_InvoiceManager.addTo_Invoice(invoice); if (count > 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加成功!');location.href='../Invoice/InvoiceList.aspx'", true); addcombank(); } } else { lblInvoiceID.Text = "<font color='red'>发票号码已存在!</font>"; this.policyList.InnerHtml = this.hidTable.Value; } }
private void bindPage() { string id = Request.QueryString["id"].ToString(); To_Invoice invoice = To_InvoiceManager.getTo_InvoiceById(Convert.ToInt32(id)); this.lblCDate.Value = invoice.InvoiceCDate.ToString("yyyy-MM-dd"); this.lblCDepart.Value = DepartmentInfoManager.getDepartmentInfoById(invoice.InvoiceCDepartment).Departcname.ToString(); this.lblCMan.Value = LoginInfoManager.getLoginInfoById(invoice.InvoiceCMan).Cname.ToString(); this.txtInvoiceID.Value = invoice.InvoiceID.ToString(); this.txtDepart.Value = invoice.Department.ToString(); this.txtInvoiceDate.Value = invoice.InvoiceDate.ToString("yyyy-MM-dd"); this.txtRemark.Value = invoice.Remark.ToString(); this.TxtSalesman.Value = LoginInfoManager.getLoginInfoById(invoice.Selasmane).Cname.ToString(); this.HidSalesman.Value = invoice.Selasmane.ToString(); this.txtSum.Value = invoice.Sum.ToString(); this.txtUnit.Value = invoice.InvoiceUnit.ToString(); this.ddlType.Items.FindByText(invoice.InvoiceType).Selected = true; this.ChkConfirm.Checked = invoice.IsSure == 1; //rpBind(invoice.Id.ToString()); rpBind(id.ToString()); }
private void bindPage() { LoginInfo login = (EtNet_Models.LoginInfo)Session["login"]; //this.txtInvoiceID.Value = "FP" + DateTime.Now.ToString("yyyyMMddHHmmss"); this.txtInvoiceDate.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string id = Request.QueryString["id"].ToString(); To_Invoice invoice = To_InvoiceManager.getTo_InvoiceById(Convert.ToInt32(id)); this.lblCDate.Text = invoice.InvoiceCDate.ToString(); this.lblCDepart.Text = DepartmentInfoManager.getDepartmentInfoById(invoice.InvoiceCDepartment).Departcname.ToString(); this.lblCMan.Text = LoginInfoManager.getLoginInfoById(invoice.InvoiceCMan).Cname.ToString(); this.txtDepart.Value = invoice.Department.ToString(); this.txtRemark.Text = invoice.Remark.ToString(); this.TxtSalesman.Value = LoginInfoManager.getLoginInfoById(invoice.Selasmane).Cname.ToString(); this.HidSalesman.Value = invoice.Selasmane.ToString(); this.txtSum.Value = invoice.Sum.ToString(); this.txtUnit.Value = invoice.InvoiceUnit.ToString(); this.ddlType.SelectedValue = invoice.InvoiceType.ToString(); //rpBind(invoice.Id.ToString()); rpBind(id.ToString()); }
/// <summary> /// 提示清空 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ibtnDeleteAll_Click(object sender, ImageClickEventArgs e) { string str = ""; if (cbAnnouncement.Checked == true) { AnnouncementInfoManager.Clear(); ClearAuditAndJobflow("04"); str += "公告管理清空完成;\\n"; } if (cbCalendar.Checked == true) { CalendarsManager.Clear(); str += "日程管理清空完成;\\n"; } if (cbCompany.Checked == true) { FactoryManager.Clear(); str += "付款单位清空完成;\\n"; } if (cbCustomer.Checked == true) { CustomerManager.Clear(); ClearAuditAndJobflow("03"); str += "收款单位清空完成;\\n"; } if (cbFinancial.Checked == true) { To_CollectingManager.Clear(); str += "收款管理清空完成;\\n"; } if (cbInfomation.Checked == true) { InformationManager.Clear(); str += "消息管理清空完成;\\n"; } if (cbInvocie.Checked == true) { To_InvoiceManager.Clear(); str += "发票管理清空完成;\\n"; } if (cbLinkInfo.Checked == true) { AddressListInfoManager.Clear(); str += "通讯录清空完成;\\n"; } if (cbPicture.Checked == true) { PictureInfoManager.Clear(); str += "图片管理清空完成;\\n"; } if (cbPolicy.Checked == true) { To_OrderInfoManager.Clear(); // ClearAuditAndJobflow("02"); str += "保单管理清空完成;\\n"; } if (cbReimbursed.Checked == true) { ClearAuditAndJobflow("01"); AusRottenInfoManager.Clear(); str += "报销管理清空完成;\\n"; } // ClientScript.RegisterStartupScript(this.GetType(), "", " <script lanuage=javascript> alert('"+ str +"');</script>"); ClientScript.RegisterClientScriptBlock(this.GetType(), "page", string.Format("alert('{0}');", str), true); }