public static string Manage(NameValueCollection querystring) { string isInsert = querystring.Get("transType"); int apid, branchid, paymentforid, number, saleid; double amount; var userProfile = WebCommon.GetUserProfile(); var accountsPayable = new AccountsPayable { APID = int.TryParse(querystring.Get("APID"), out apid) ? apid: 0, BranchID = int.TryParse(querystring.Get("BranchID"), out branchid) ? branchid : 0, Date = querystring.Get("Date"), PaymentForID = int.TryParse(querystring.Get("PaymentForID"), out paymentforid) ? paymentforid : 0, Number = int.TryParse(querystring.Get("Number"), out number) ? number : 0, SaleID = int.TryParse(querystring.Get("SaleID"), out saleid) ? saleid : 0, Amount = double.TryParse(querystring.Get("Amount"), out amount) ? amount : 0, Particulars = querystring.Get("Particulars"), UserID = userProfile.UserId }; string param = WebCommon.ToXML(accountsPayable); return(AccountsPayableDAL.Manage(param, isInsert)); }
public static List <AccountsPayable> GetAccountsPayable(string criteria, int branchid) { var dbUtil = new DatabaseManager(); var accountsPayables = new List <AccountsPayable>(); using (var conn = new SqlConnection(dbUtil.getSQLConnectionString("MainDB"))) { conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "spDisGetAP"; cmd.CommandTimeout = 180; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@strCriteria", criteria); cmd.Parameters.AddWithValue("@intBranchID", branchid); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { var accountsPayable = new AccountsPayable { APID = ReferenceEquals(reader["intAPID"], DBNull.Value) ? 0 : Convert.ToInt32(reader["intAPID"]), BranchID = ReferenceEquals(reader["intBranchID"], DBNull.Value) ? 0 : Convert.ToInt32(reader["intBranchID"]), Branch = ReferenceEquals(reader["strBranch"], DBNull.Value) ? string.Empty : Convert.ToString(reader["strBranch"]), Date = ReferenceEquals(reader["datDate"], DBNull.Value) ? string.Empty : Convert.ToString(reader["datDate"]), PaymentForID = ReferenceEquals(reader["intPaymentForID"], DBNull.Value) ? 0 : Convert.ToInt32(reader["intPaymentForID"]), PaymentFor = ReferenceEquals(reader["strPaymentFor"], DBNull.Value) ? string.Empty : Convert.ToString(reader["strPaymentFor"]), SaleID = ReferenceEquals(reader["intSaleID"], DBNull.Value) ? 0 : Convert.ToInt32(reader["intSaleID"]), AccountCode = ReferenceEquals(reader["strAccountCode"], DBNull.Value) ? string.Empty : Convert.ToString(reader["strAccountCode"]), Customer = ReferenceEquals(reader["strCustomer"], DBNull.Value) ? string.Empty : Convert.ToString(reader["strCustomer"]), Particulars = ReferenceEquals(reader["strParticulars"], DBNull.Value) ? string.Empty : Convert.ToString(reader["strParticulars"]) }; accountsPayables.Add(accountsPayable); } return(accountsPayables); } } } }
public FinancialViewModel(AccountsPayable obj) { this.m_payable = obj; }
public AccountsPayableViewModel(AccountsPayable m, AtlanticDXContext db) { // TODO: Complete member initialization this.m = m; this.db = db; }