protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; ContractAdapter ca = new ContractAdapter(); show(ca.getContractSummary()); }
private void setData(string id) { if (string.IsNullOrEmpty(id)) { return; } ContractAdapter ca = new ContractAdapter(); T_ContractHead head = ca.getContractDetail(id); lbl_title.Text = lbl_xufang.Text = lbl_xufang2.Text = head.Xufang; lbl_contract_id.Text = id; lbl_xufang_address.Text = head.XufangAddress; lbl_xufang_jingbanren.Text = head.XufangJingbanren; lbl_xufang_tel.Text = head.XufangTel; lbl_gongfang.Text = lbl_gongfang2.Text = head.Gongfang; lbl_gongfang_jingban.Text = head.GongfangJingbanren; lbl_gongfang_tel.Text = head.GongfangTel; lbl_delivery_mode.Text = head.DeliveryMode; lbl_payment_days.Text = head.PaymentDays.ToString(); lbl_xufang_fadingdaibiaoren.Text = head.XufangFadingdaibiaoren; lbl_xufang_dailiren.Text = head.XufangDailiren; lbl_xufang_qianding_date.Text = string.Format("{0:yyyy 年 MM 月dd 日}", head.XufangQianziDate); lbl_gongfang_fadingdaibiaoren.Text = head.GongfangFadingdaibiaoren; lbl_gongfang_dailiren.Text = head.GongfangDailiren; lbl_gongfang_qianding_date.Text = string.Format("{0:yyyy 年 MM 月dd 日}", head.GongfangQianziDate); gridviewBind(head.lists); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ContractAdapter ca = new ContractAdapter(); show(ca.getContractSummary()); } }
public static IServiceCollection CreateSingletonForEachAdapter(this IServiceCollection services, string postgresConfig) { accountAdapter = new AccountAdapter(postgresConfig); contractAdapter = new ContractAdapter(postgresConfig); deviceAdapter = new DeviceAdapter(postgresConfig); subscriberAdapter = new SubscriberAdapter(postgresConfig); return(services? .AddSingleton(accountAdapter) .AddSingleton(contractAdapter) .AddSingleton(deviceAdapter) .AddSingleton(subscriberAdapter)); }
protected void query_Click(object sender, EventArgs e) { T_ContractHead head = new T_ContractHead(); if (!string.IsNullOrEmpty(txt_contract_id.Text)) { head.ContractId = txt_contract_id.Text.Trim(); } if (!string.IsNullOrEmpty(txt_entry_id.Text.Trim())) { head.baoguandanhao = txt_entry_id.Text.Trim(); } if (!string.IsNullOrEmpty(txt_sale_bill_no.Text.Trim())) { head.xiaoshoufapiaohao = txt_sale_bill_no.Text.Trim(); } if (!string.IsNullOrEmpty(txt_xufang.Text.Trim())) { head.Xufang = txt_xufang.Text.Trim(); } if (!string.IsNullOrEmpty(txt_xufang_jingbanren.Text.Trim())) { head.XufangJingbanren = txt_xufang_jingbanren.Text.Trim(); } if (!string.IsNullOrEmpty(CalendarBox1.Text.Trim())) { head.startTime = DateTime.Parse(CalendarBox1.Text.Trim()); } if (!string.IsNullOrEmpty(CalendarBox2.Text.Trim())) { head.endTime = DateTime.Parse(CalendarBox2.Text.Trim()); } ContractAdapter contractA = new ContractAdapter(); show(contractA.queryContractSummary(head)); }
/// <summary> /// 保存并导出excel /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { Label1.Text = ""; Label1.Visible = false; //合同表头 T_ContractHead contractHead = new T_ContractHead(); //需方信息 contractHead.Xufang = TextBox12.Text.Trim(); contractHead.XufangAddress = TextBox4.Text.Trim(); contractHead.XufangJingbanren = TextBox3.Text.Trim(); contractHead.XufangTel = TextBox2.Text.Trim(); contractHead.XufangFadingdaibiaoren = TextBox8.Text.Trim(); contractHead.XufangDailiren = TextBox10.Text.Trim(); if (!string.IsNullOrEmpty(CalendarBox1.Text.Trim())) { contractHead.XufangQianziDate = DateTime.Parse(CalendarBox1.Text.Trim()); } //供方信息 contractHead.Gongfang = ddlGongFang.SelectedItem.Text; contractHead.GongfangTel = TextBox6.Text.Trim(); contractHead.GongfangJingbanren = TextBox5.Text.Trim(); contractHead.GongfangDailiren = TextBox11.Text.Trim(); contractHead.GongfangFadingdaibiaoren = TextBox9.Text.Trim(); if (!string.IsNullOrEmpty(CalendarBox2.Text.Trim())) { contractHead.GongfangQianziDate = DateTime.Parse(CalendarBox2.Text.Trim()); } //合同其他信息 if (string.IsNullOrEmpty(TextBox1.Text.Trim())) { return; } contractHead.ContractId = TextBox1.Text.Trim(); TextBox tb = (TextBox)GridView1.Rows[0].Cells[0].FindControl("txt_delivery_date"); if (!string.IsNullOrEmpty(tb.Text.Trim())) { contractHead.DeliveryDate = DateTime.Parse(tb.Text.Trim()); } Label inner_lb_all = GridView1.Rows[GridView1.Rows.Count - 1].Cells[5].FindControl("txt_invoice_total") as Label; if (!string.IsNullOrEmpty(inner_lb_all.Text.Trim())) { contractHead.InvoiceAll = decimal.Parse(inner_lb_all.Text.Trim()); } else { contractHead.InvoiceAll = Decimal.Zero; } if (!string.IsNullOrEmpty(TextBox7.Text.Trim())) { contractHead.PaymentDays = Int32.Parse(TextBox7.Text.Trim()); } contractHead.DeliveryMode = DropDownList1.SelectedValue; //合同表体 List <T_ContractList> contract_lists = new List <T_ContractList>(); for (int i = 0; i < GridView1.Rows.Count - 1; i++) { T_ContractList list = new T_ContractList(); list.ContractId = contractHead.ContractId; list.ContractNo = i + 1; HiddenField hdf1 = GridView1.Rows[i].Cells[0].FindControl("hdf_entry_id") as HiddenField; list.EntryId = hdf1.Value; HiddenField hdf2 = GridView1.Rows[i].Cells[0].FindControl("hdf_g_no") as HiddenField; HiddenField hdf3 = GridView1.Rows[i].Cells[0].FindControl("hnf_sale_bill_no") as HiddenField; list.SaleBillNo = hdf3.Value.Trim(); list.GNo = Int32.Parse(hdf2.Value.Trim()); list.GName = GridView1.Rows[i].Cells[1].Text; list.GQty = decimal.Parse(GridView1.Rows[i].Cells[2].Text.Trim()); list.GUnit = GridView1.Rows[i].Cells[3].Text; TextBox tb1 = GridView1.Rows[i].Cells[4].FindControl("txt_invoice_price") as TextBox; if (!string.IsNullOrEmpty(tb1.Text.Trim())) { list.InvoicePrice = decimal.Parse(tb1.Text.Trim()); } else { list.InvoicePrice = decimal.Zero; } Label lb1 = GridView1.Rows[i].Cells[5].FindControl("txt_invoice_total") as Label; if (!string.IsNullOrEmpty(lb1.Text.Trim())) { list.InvoiceTotal = decimal.Parse(lb1.Text.Trim()); } else { list.InvoiceTotal = decimal.Zero; } contract_lists.Add(list); } try { ContractAdapter ca = new ContractAdapter(); EntryAdapter ea = new EntryAdapter(); TaxListAdapter ta = new TaxListAdapter(); ca.addContractHead(contractHead); ca.addContractList(contract_lists); //生成tax_list记录 decimal bilu = decimal.Parse(ConfigurationManager.AppSettings["bilv"].ToString()); ta.generateTaxList(bilu); //更新entry_list的invoice_flag标志位为Ture ea.invoice(contract_lists); } catch (Exception ex) { Label1.Text = ex.Message; Label1.Visible = true; return; } string filename; string server_file_path; bool result = DataTableToExcel(contractHead, contract_lists, out filename, out server_file_path); if (result) { //开始下载 BigFileDownload(filename, server_file_path); } else { Response.Write("导出数据失败"); } //Page.ClientScript.RegisterStartupScript(this.GetType(), "", " <script lanuage=javascript>alert('开票成功!');window.opener=null;window.top.open('','_self','');window.top.close(this);</script>"); }
public static async Task <int> GetId(IResolverContext context, [Parent] Contract contract, [Service] ContractAdapter data) => contract.Id = contract.Id == default ? await context.BatchDataLoader <long, int>("getContractsIds", data.GetIds).LoadAsync(contract.Id) : contract.Id;
public static async Task <long> GetSubscriberId(IResolverContext context, [Parent] Contract contract, [Service] ContractAdapter data) => contract.Id != default ? await context.BatchDataLoader <int, int>("getSubscriberIdsByIds", data.GetSubscriberIdsByIds).LoadAsync(contract.Id) : await context.BatchDataLoader <long, int>("getSubscriberIdsByNums", data.GetSubscriberIdsByNums).LoadAsync(contract.Number);
public static async Task <IEnumerable <Account> > GetAccounts(IResolverContext context, [Parent] Contract contract, [Service] ContractAdapter data) => contract.Accounts = (contract.Id != default
public static async Task <DateTime> GetCreationDate(IResolverContext context, [Parent] Contract contract, [Service] ContractAdapter data) => contract.Id != default ? await context.BatchDataLoader <int, DateTime>("getContractsDatesByIds", data.GetDatesByIds).LoadAsync(contract.Id) : await context.BatchDataLoader <long, DateTime>("getContractsDatesByNums", data.GetDatesByNums).LoadAsync(contract.Number);
public static async Task <long> GetNumber(IResolverContext context, [Parent] Contract contract, [Service] ContractAdapter data) => contract.Number = contract.Number = contract.Number == default ? await context.BatchDataLoader <int, long>("getContractsNumbers", data.GetNumbers).LoadAsync(contract.Id) : contract.Number;