protected void query_Click(object sender, EventArgs e) { Label2.Text = ""; Label2.Visible = false; ProfitBudgetAdapter pba = new ProfitBudgetAdapter(); T_ProfitBudget item = new T_ProfitBudget(); sale_bill_no = this.txt_sale_bill_no.Text.Trim(); //判断是否提交过 DataSet ds = pba.getProfitBudgetSummaryByID(sale_bill_no); if (ds.Tables[0].Rows.Count > 0) { Label2.Text = "该销售订单号已经提交过利润预算!"; Label2.Visible = true; return; } item.SaleBillNo = sale_bill_no; ds = pba.getSEOrderInfo(item); if (ds.Tables[0].Rows.Count > 0) { finterid = Int32.Parse(ds.Tables[0].Rows[0][0].ToString()); show(ds); } }
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; ProfitBudgetAdapter pba = new ProfitBudgetAdapter(); T_ProfitBudget item = new T_ProfitBudget(); sale_bill_no = this.txt_sale_bill_no.Text.Trim(); item.SaleBillNo = sale_bill_no; show(pba.getSEOrderInfo(item)); }
protected void submit_Click(object sender, EventArgs e) { //收集利润预算表头信息 T_ProfitBudget item = new T_ProfitBudget(); item.UpdateTime = DateTime.Now; decimal extra_charges = 0; if (!string.IsNullOrEmpty(txt_extra_charges.Text.Trim())) { extra_charges = Decimal.Parse(txt_extra_charges.Text.Trim()); } item.ExtraCharges = extra_charges; item.FInterID = finterid; item.SaleBillNo = sale_bill_no; item.AuditState = false; //收集利润预算表体信息 List <T_ProfitBudgetList> lists = new List <T_ProfitBudgetList>(); for (int i = 0; i <= GridView1.Rows.Count - 1; i++) { T_ProfitBudgetList list = new T_ProfitBudgetList(); list.FInterID = Int32.Parse(((HiddenField)GridView1.Rows[i].Cells[18].FindControl("hdf_finter_id")).Value); list.SaleFentryid = Int32.Parse(((HiddenField)GridView1.Rows[i].Cells[18].FindControl("hdf_sale_fentry_id")).Value); list.BuyFentryid = Int32.Parse(((HiddenField)GridView1.Rows[i].Cells[18].FindControl("hdf_buy_fentry_id")).Value); list.FItemID = Int32.Parse(((HiddenField)GridView1.Rows[i].Cells[18].FindControl("hdf_fitem_id")).Value); list.SaleBillNo = sale_bill_no; list.BuyBillNo = GridView1.Rows[i].Cells[0].Text; list.DeptId = Int32.Parse(GridView1.Rows[i].Cells[1].Text); list.EmpId = Int32.Parse(GridView1.Rows[i].Cells[2].Text); list.SalePrice = Decimal.Parse(GridView1.Rows[i].Cells[3].Text); list.Currency = GridView1.Rows[i].Cells[4].Text; TextBox txt_exchange_rate = (TextBox)GridView1.Rows[i].Cells[5].FindControl("txt_exchange_rate"); if (string.IsNullOrEmpty(txt_exchange_rate.Text)) { list.ExchangeRate = 0; } else { list.ExchangeRate = Decimal.Parse(txt_exchange_rate.Text); } list.BuyPrice = Decimal.Parse(GridView1.Rows[i].Cells[7].Text); list.SaleQty = Decimal.Parse(GridView1.Rows[i].Cells[9].Text); list.BuyQty = Decimal.Parse(GridView1.Rows[i].Cells[10].Text); list.Accessory = (GridView1.Rows[i].Cells[11].FindControl("txt_accessory") as TextBox).Text; TextBox txt_accessory_price = GridView1.Rows[i].Cells[12].FindControl("txt_accessory_price") as TextBox; if (!String.IsNullOrEmpty(txt_accessory_price.Text)) { list.AccessoryPrice = Decimal.Parse(txt_accessory_price.Text); } else { list.AccessoryPrice = 0; } string length = (GridView1.Rows[i].Cells[13].FindControl("txt_length") as TextBox).Text; if (string.IsNullOrEmpty(length)) { list.Length = 0; } else { list.Length = Decimal.Parse(length); } string width = (GridView1.Rows[i].Cells[13].FindControl("txt_width") as TextBox).Text; if (string.IsNullOrEmpty(width)) { list.Width = 0; } else { list.Width = Decimal.Parse(width); } string height = (GridView1.Rows[i].Cells[13].FindControl("txt_height") as TextBox).Text; if (string.IsNullOrEmpty(height)) { list.Height = 0; } else { list.Height = Decimal.Parse(height); } string capacity = (GridView1.Rows[i].Cells[16].FindControl("txt_capacity") as TextBox).Text; if (string.IsNullOrEmpty(capacity)) { list.Capacity = 0; } else { list.Capacity = Decimal.Parse(capacity); } string estimate_freight_charge = (GridView1.Rows[i].Cells[15].FindControl("txt_estimate_freight_charge") as TextBox).Text; if (string.IsNullOrEmpty(estimate_freight_charge)) { list.EstimateFreightCharge = 0; } else { list.EstimateFreightCharge = Decimal.Parse(estimate_freight_charge); } string tax_rate = (GridView1.Rows[i].Cells[17].FindControl("txt_tax_rate") as TextBox).Text; if (string.IsNullOrEmpty(tax_rate)) { list.TaxRate = 0; } else { list.TaxRate = Decimal.Parse(tax_rate); } list.SaleRate = GridView1.Rows[i].Cells[6].Text == "是" ? true : false; list.BuyRate = GridView1.Rows[i].Cells[8].Text == "是" ? true : false; string profit = (GridView1.Rows[i].Cells[18].FindControl("lbl_profit") as Label).Text; if (string.IsNullOrEmpty(profit)) { list.Profit = 0; } else { list.Profit = Decimal.Parse(profit); } string volume = (GridView1.Rows[i].Cells[14].FindControl("lbl_volume") as Label).Text; if (string.IsNullOrEmpty(volume)) { list.Volume = 0; } else { list.Volume = Decimal.Parse(volume); } string return_rate = (GridView1.Rows[i].Cells[18].FindControl("txt_return_rate") as TextBox).Text; if (string.IsNullOrEmpty(return_rate)) { list.ReturnRate = 0; } else { list.ReturnRate = Decimal.Parse(return_rate); } lists.Add(list); } try { ProfitBudgetAdapter pba = new ProfitBudgetAdapter(); pba.updateProfitBudgetHead(item); pba.updateProfitBudgetList(lists); Label2.Text = "保存成功!"; Label2.Visible = true; GridViewBind(); GridView2.SelectedIndex = -1; } catch (Exception ex) { Label2.Text = ex.Message; Label2.Visible = true; return; } }
public void updateProfitBudgetHead(T_ProfitBudget item) { Manager.updateProfitBudgetHead(item); }
public void addProfitBudgetHead(T_ProfitBudget item) { Manager.addProfitBudgetHead(item); }
public DataSet getSEOrderInfo(T_ProfitBudget item) { return(Manager.getSEOrderInfo(item)); }