public DataTable All(tbl_sale p) { DataTable programs = new DataTable(); try { Dictionary <string, object> parameters = new Dictionary <string, object>(); DataTable dt = helper.GetDataTableFromStoredProc(SP.Selectsaleid, parameters); foreach (DataRow dr in dt.Rows) { p.sale_id = Convert.ToInt32(dr["order_id"].ToString()); } programs = dt; } catch (Exception ex) { ErrorLog.saveerror(ex); } return(programs); }
public DataTable SaleInvoice(tbl_sale p) { DataTable programs = new DataTable(); try { Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("@company_id", p.company_id); parameters.Add("@sale_id", p.sale_id); //DataTable dt = helper.GetDataTableFromStoredProc(SP.SelectSaleinvoice, parameters); //foreach (DataRow dr in dt.Rows) //{ // p.party_id = Convert.ToInt32(dr["party_id"].ToString()); // p.actual_amount = Convert.ToDecimal(dr["actual_amount"].ToString()); // p.date = (dr["Date"].ToString()); // p.total_discount = Convert.ToDecimal(dr["total_discount"].ToString()); // p.invoice_no = (dr["invoice_no"].ToString()); // p.grand_total = Convert.ToDecimal(dr["grand_total"]); // p.total_tax = Convert.ToDecimal(dr["total_tax"]); // p.party_name = (dr["party_name"].ToString()); // p.balance = Convert.ToDecimal(dr["balance_amt"].ToString()); // p.given = Convert.ToDecimal(dr["given_amt"].ToString()); //} //programs = dt; } catch (Exception ex) { ErrorLog.saveerror(ex); } return(programs); }