public int Update(Models.MPayments model) { Common.Logger l = new Common.Logger(); string ClassName = "CPayment"; try { var query = from o in obj.Payments where o.id == model.id select o; foreach (var item in query) { item.ClientId = model.ClientId; item.VendorId = model.VendorId; item.OrderId = model.OrderId; item.TransactionId = model.TransactionId; item.Paid = model.Paid; item.PaymentType = model.PaymentType; item.PaymentState = model.Paymentstate; } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] ClientId[" + model.ClientId + "] VendorId[" + model.VendorId + "] OrderId[" + model.OrderId + "] TransactionId [ " + model.TransactionId + "] Paid [ " + model.Paid + " ] PaymentType[ " + model.PaymentType + " ] PaymentState [ " + model.Paymentstate + " ]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MUserToEmployee model) { Common.Logger l = new Common.Logger(); string ClassName = "CUserToEmployee"; try { var query = from o in obj.UserToEmployees where o.id == model.id select o; foreach (var item in query) { item.EmployeeId = model.EmployeeId; item.UserId = model.UserId; } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] EmployeeId[" + model.EmployeeId + "] UserId[" + model.UserId + "] "); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MProducts model) { Common.Logger l = new Common.Logger(); string ClassName = "CProducts"; try { DB.Product bs = new DB.Product(); //bs.id = int.Parse(model.id); bs.ProductCode = model.ProductCode; bs.Name = model.Name; bs.tag1 = model.tag1; bs.tag2 = model.tag1; bs.tag3 = model.tag3; bs.costPrice = model.CostPrice; bs.salePrice = model.SalePrice; bs.Manufacturer = model.Manufacturer; bs.Description = model.description; bs.VendorId = int.Parse(model.Vendorld); bs.FiscalYearId = Convert.ToInt32(model.FiscalYearld); bs.eDate = DateTime.Now; bs.WareHouseId = Convert.ToInt32(model.WareHouseId); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] ProductCode[" + model.ProductCode + "] Name[" + model.Name + "] tag1[" + model.tag1 + "] tag2[ " + model.tag2 + "] tag3 [" + model.tag3 + " ] Manufacture[ " + model.Manufacturer + " ] Description [ " + model.description + "] VendorId [ " + model.Vendorld + "] FiscalYearId [ " + model.FiscalYearld + "] eDate[ " + model.eDate + "]"); obj.Products.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MIncomeStatement model) { Common.Logger l = new Common.Logger(); string ClassName = "CIncomeStatement"; try { DB.IncomeStatement bs = new DB.IncomeStatement(); bs.Type = model.Type; bs.AccountId = model.Accountid; bs.AccountName = model.AccountName; bs.value = int.Parse(model.value); bs.NetProfit = model.NetProfit; l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values Type[" + model.Type + "] AccountId[" + model.Accountid + "] AccountName[" + model.AccountName + "] Value[" + model.value + "] NetProfit[" + model.NetProfit + " ]"); obj.IncomeStatements.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MAllowancePaid model) { Common.Logger l = new Common.Logger(); string ClassName = "CAllowancePaid"; try { var query = from o in obj.AllowancesPaids where Convert.ToString(o.id) == model.id select o; foreach (var item in query) { item.PaidSalaryId = int.Parse(model.PaidSalaryId); item.AllowancePaid = model.AllowancePaid; item.AllowanceTitle = model.AllowanceTitle; } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] PaidsalaryId[" + model.PaidSalaryId + "] AllowancePaid[" + model.AllowancePaid + "] AllowanceTitle[" + model.AllowanceTitle + "]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MPaidSalary model) { Common.Logger l = new Common.Logger(); string ClassName = "CPaidSalary"; try { DB.PaidSalary bs = new DB.PaidSalary(); bs.id = Convert.ToInt32(model.id); bs.EmployeeId = Convert.ToInt32(model.EmployeeId); bs.SalaryId = Convert.ToInt32(model.SalaryId); bs.MonthPaid = model.MonthPaid; bs.Paid = model.Paid; bs.DatePaid = Convert.ToDateTime(model.DatePaid); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] EmployeeId[" + model.EmployeeId + "] SalaryId[" + model.SalaryId + "] MonthPaid[" + model.MonthPaid + "] Paid [ " + model.Paid + " ]"); obj.PaidSalaries.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MInvoiceItems model) { Common.Logger l = new Common.Logger(); string ClassName = "CInvoicedetailId"; try { DB.InvoiceItem bs = new DB.InvoiceItem(); bs.id = Convert.ToInt32(model.id); bs.InvoicedetailId = Convert.ToInt32(model.InvoiceDetailId); bs.ProductId = Convert.ToInt32(model.ProductId); bs.ProductCost = model.ProductCost; l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] InvoicedetailId[" + model.InvoiceDetailId + "] ProductId[" + model.ProductId + "] ProductCost[" + model.ProductCost + "]"); obj.InvoiceItems.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MClients model) { Common.Logger l = new Common.Logger(); string ClassName = "CClients"; try { var query = from o in obj.Clients where o.id == model.id select o; foreach (var item in query) { item.ClientTypeId = int.Parse(model.ClientTypeld); item.Name = model.Name; item.EmailAddress = model.EmailAddress; item.Address1 = model.EmailAddress; item.Address2 = model.Address2; item.City = model.City; item.isVendor = model.isVendor; item.eDate = Convert.ToDateTime(model.edate); } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model id[" + model.id + "] ClientTypeId[" + model.ClientTypeld + "] Name[" + model.Name + "] phone[" + model.phone + "] EmailAddress[ " + model.EmailAddress + "] Address1 [" + model.Address1 + "] Address2 [" + model.Address2 + "] City [" + model.City + "] isVendor[ " + model.isVendor + "] eDate[ " + model.edate + "]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Delete(Models.MClients model) { Common.Logger l = new Common.Logger(); string ClassName = "CClients"; try { var query = from o in obj.Clients where o.id == model.id select o; foreach (var item in query) { obj.Clients.DeleteOnSubmit(item); } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model id[" + model.id + "] ClientTypeId[" + model.ClientTypeld + "] Name[" + model.Name + "] phone[" + model.phone + "] EmailAddress[ " + model.EmailAddress + "] Address1 [" + model.Address1 + "] Address2 [" + model.Address2 + "] City [" + model.City + "] isVendor[ " + model.isVendor + "] eDate[ " + model.edate + "]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Deleted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MCashAccount model) { Common.Logger l = new Common.Logger(); string ClassName = "CAccounttransaction"; try { var query = from o in obj.CashAccounts where o.id == model.id select o; foreach (var item in query) { item.CashAccountName = model.CashAccountName; item.WareHouseId = model.WareHouseId; item.OpeningBalance = model.OpeningBalance; item.BeginDate = model.BeginDate; item.ClientId = model.ClientId; item.VendorId = model.VendorId; } // l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] AccountId[" + model.AccountId + "] Total[" + model.Total + "] CurrentTransaction[" + model.CurrentTransaction + "] TransactionType [ " + model.Transactiontype + " ] FiscalYearId [ " + model.FiscalYearId + " ] eDate [" + model.eDate + " ]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MClients model) { Common.Logger l = new Common.Logger(); string ClassName = "CClients"; try { DB.Client bs = new DB.Client(); bs.id = Convert.ToInt32(model.id); bs.ClientTypeId = Convert.ToInt32(model.ClientTypeld); bs.Name = model.Name; bs.phone = model.phone; bs.EmailAddress = model.EmailAddress; bs.Address1 = model.Address1; bs.Address2 = model.Address2; bs.City = model.City; bs.isVendor = model.isVendor; bs.eDate = Convert.ToDateTime(model.edate); bs.WareHouseId = Convert.ToInt32(model.WareHouseId); bs.NIC = model.NIC; bs.GrantorName = model.GrantorName; bs.GrantorNIC = model.GrantorNIC; l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model id[" + model.id + "] ClientTypeId[" + model.ClientTypeld + "] Name[" + model.Name + "] phone[" + model.phone + "] EmailAddress[ " + model.EmailAddress + "] Address1 [" + model.Address1 + "] Address2 [" + model.Address2 + "] City [" + model.City + "] isVendor[ " + model.isVendor + "] eDate[ " + model.edate + "]"); obj.Clients.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MCashAccount model) { Common.Logger l = new Common.Logger(); string ClassName = "CAccounttransaction"; try { DB.CashAccount bs = new DB.CashAccount(); bs.CashAccountName = model.CashAccountName; bs.WareHouseId = model.WareHouseId; bs.OpeningBalance = model.OpeningBalance; bs.BeginDate = model.BeginDate; bs.ClientId = model.ClientId; bs.VendorId = model.VendorId; bs.AccountType = model.AccountType; // l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] AccountId[" + model.AccountId + "] Total[" + model.Total + "] CurrentTransaction[" + model.CurrentTransaction + "] TransactionType [ " + model.Transactiontype + " ] FiscalYearId [ " + model.FiscalYearId + " ] eDate [" + model.eDate + " ]"); obj.CashAccounts.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MInvoiceDetails model) { Common.Logger l = new Common.Logger(); string ClassName = "CInvoicedetail"; try { DB.InvoiceDetail bs = new DB.InvoiceDetail(); bs.id = Convert.ToInt32(model.id); bs.InvoiceId = Convert.ToInt32(model.InvoiceId); bs.OrderId = Convert.ToInt32(model.OrderId); bs.VendorId = Convert.ToInt32(model.VendorId); bs.CustomerId = Convert.ToInt32(model.Customer); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] InvoiceId[" + model.InvoiceId + "] OrderId[" + model.OrderId + "] VendorId[" + model.VendorId + "] CustomerId[ " + model.Customer + " ]"); obj.InvoiceDetails.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int UpdateAmountPaid(int PaymentId, string AmountPaid) { Common.Logger l = new Common.Logger(); string ClassName = "CPayment"; try { var query = from o in obj.Payments where o.id == PaymentId select o; foreach (var item in query) { item.Paid = AmountPaid; if (item.Paid == item.TotalCost) { item.PaymentState = Common.Constants.PaymentState.Paid.ToString(); } } //l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] ClientId[" + model.ClientId + "] VendorId[" + model.VendorId + "] OrderId[" + model.OrderId + "] TransactionId [ " + model.TransactionId + "] Paid [ " + model.Paid + " ] PaymentType[ " + model.PaymentType + " ] PaymentState [ " + model.Paymentstate + " ]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.PaymentContainer model) { Common.Logger l = new Common.Logger(); string ClassName = "CPaymentContainer"; try { DB.PaymentBankContainer bs = new DB.PaymentBankContainer(); bs.id = Convert.ToInt32(model.id); bs.PaymentId = model.PaymentId; bs.BankId = model.BankId; bs.AmountRemaining = model.AmountRemaning; l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] PaymentId[" + model.PaymentId + "] BankId[" + model.BankId + "] AmountRemaining[" + model.AmountRemaning + "] "); obj.PaymentBankContainers.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MVendor model) { Common.Logger l = new Common.Logger(); string ClassName = "CVendor"; try { DB.Vendor bs = new DB.Vendor(); bs.id = Convert.ToInt32(model.id); bs.name = model.name; bs.Address = model.Addreess; bs.phone = model.phone; bs.WareHouseId = Convert.ToInt32(model.WareHouseId); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] name[" + model.name + "] Address[" + model.Addreess + "] phone[" + model.phone + "]"); obj.Vendors.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.PaymentContainer model) { Common.Logger l = new Common.Logger(); string ClassName = "CPaymentContainer"; try { var query = from o in obj.PaymentBankContainers where o.id == model.id select o; foreach (var item in query) { item.PaymentId = model.PaymentId; item.BankId = model.BankId; item.AmountRemaining = model.AmountRemaning; } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] PaymentId[" + model.PaymentId + "] BankId[" + model.BankId + "] AmountRemaining[" + model.AmountRemaning + "] "); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MVendor model) { Common.Logger l = new Common.Logger(); string ClassName = "CVendor"; try { var query = from o in obj.Vendors where Convert.ToString(o.id) == model.id select o; foreach (var item in query) { item.name = model.name; item.Address = model.Addreess; item.phone = model.phone; } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] name[" + model.name + "] Adress[" + model.Addreess + "] phone[" + model.phone + "]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MPaidSalary model) { Common.Logger l = new Common.Logger(); string ClassName = "CPaidSalary"; try { var query = from o in obj.PaidSalaries where Convert.ToString(o.id) == model.id select o; foreach (var item in query) { item.EmployeeId = Convert.ToInt32(model.EmployeeId); item.SalaryId = Convert.ToInt32(model.SalaryId); item.MonthPaid = model.MonthPaid; } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] EmployeeId[" + model.EmployeeId + "] SalaryId[" + model.SalaryId + "] MonthPaid[" + model.MonthPaid + "] Paid [ " + model.Paid + " ]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MOrdersLine model) { Common.Logger l = new Common.Logger(); string ClassName = "COrderLine"; try { DB.OrderLine bs = new DB.OrderLine(); bs.OrderId = Convert.ToInt32(model.OrderId); bs.ProductId = Convert.ToInt32(model.ProductId); bs.SalePrice = model.SalePrice; bs.units = model.unit; bs.totalProductCost = model.totalProductCost; bs.eDate = Convert.ToDateTime(model.eDate); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] OrderId[" + model.OrderId + "] ProductId[" + model.ProductId + "] SalePrice[" + model.SalePrice + "] units [" + model.unit + " ] totalProductCost [ " + model.totalProductCost + " ] eDate[ " + model.eDate + "]"); obj.OrderLines.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MInvoiceItems model) { Common.Logger l = new Common.Logger(); string ClassName = "CInvoicedetailId"; try { var query = from o in obj.InvoiceItems where Convert.ToString(o.id) == model.id select o; foreach (var item in query) { item.InvoicedetailId = Convert.ToInt32(model.InvoiceDetailId); item.ProductId = Convert.ToInt32(model.ProductId); item.ProductCost = model.ProductCost; } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] InvoicedetailId[" + model.InvoiceDetailId + "] ProductId[" + model.ProductId + "] ProductCost[" + model.ProductCost + "]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MPostings model) { Common.Logger l = new Common.Logger(); string ClassName = "CPostings"; try { DB.Posting bs = new DB.Posting(); bs.id = Convert.ToInt32(model.id); bs.acc_id = Convert.ToInt32(model.acc_id); bs.acc_num = model.acc_num; bs.type = model.type; bs.amount = Convert.ToSingle(model.amount); bs.e_date = Convert.ToDateTime(model.e_date); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] acc_id[" + model.acc_id + "] acc_num[" + model.acc_num + "] type[" + model.type + "] amount [ " + model.amount + " ] e_date [" + model.e_date + " ]"); obj.Postings.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MAllowancePaid model) { Common.Logger l = new Common.Logger(); string ClassName = "CAllowancePaid"; try { DB.AllowancesPaid bs = new DB.AllowancesPaid(); bs.id = int.Parse(model.id); bs.PaidSalaryId = int.Parse(model.PaidSalaryId); bs.AllowancePaid = model.AllowancePaid; bs.AllowanceTitle = model.AllowanceTitle; l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] PaidsalaryId[" + model.PaidSalaryId + "] AllowancePaid[" + model.AllowancePaid + "] AllowanceTitle[" + model.AllowanceTitle + "]"); obj.AllowancesPaids.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MPostings model) { Common.Logger l = new Common.Logger(); string ClassName = "CPostings"; try { var query = from o in obj.Postings where Convert.ToString(o.id) == model.id select o; foreach (var item in query) { item.acc_id = Convert.ToInt32(model.acc_id); item.acc_num = model.acc_num; item.type = model.type; item.amount = Convert.ToSingle(model.amount); item.e_date = Convert.ToDateTime(model.e_date); } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] acc_id[" + model.acc_id + "] acc_num[" + model.acc_num + "] type[" + model.type + "] amount [ " + model.amount + " ] e_date [" + model.e_date + " ]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MUserToEmployee model) { Common.Logger l = new Common.Logger(); string ClassName = "CUserToEmployee"; try { DB.UserToEmployee bs = new DB.UserToEmployee(); bs.id = model.id; bs.EmployeeId = model.EmployeeId; bs.UserId = model.UserId; l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] EmployeeId[" + model.EmployeeId + "] UserId[" + model.UserId + "] "); obj.UserToEmployees.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MTransaction model) { Common.Logger l = new Common.Logger(); string ClassName = "CTransaction"; try { DB.Transaction bs = new DB.Transaction(); bs.id = int.Parse(model.id); bs.TransactionDetails = model.TransactionDetails; bs.TransactionType = model.TransactionType; bs.OrderId = int.Parse(model.OrderId); bs.ClientId = int.Parse(model.ClientId); bs.VendorId = int.Parse(model.FiscalYearId); bs.eDate = Convert.ToDateTime(model.eDate); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] TransactionDetail[" + model.TransactionDetails + "] TransactionType[" + model.TransactionType + "] OrderId[" + model.OrderId + "] ClientId[ " + model.ClientId + " ] VendorId[ " + model.VendorId + " ] FiscalYearId[ " + model.FiscalYearId + " ] eDate [ " + model.eDate + " ]"); obj.Transactions.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MOrders model) { Common.Logger l = new Common.Logger(); string ClassName = "COrder"; try { var query = from o in obj.Orders where Convert.ToString(o.id) == Convert.ToString(model.id) select o; foreach (var item in query) { item.OrderNo = model.OrdersNo; item.OrderName = model.OrderName; item.OrderDescription = model.OrderDescription; item.OrderDate = Convert.ToDateTime(model.Orderdate); item.deliveryDate = Convert.ToDateTime(model.deliverydate); item.TotalCost = model.TotalCost; item.OrderType = model.OrderType; item.ClientId = Convert.ToInt32(model.ClientId); item.VendorId = Convert.ToInt32(model.venorld); item.FiscalYearId = Convert.ToInt32(model.FiscalYearld); item.eDate = Convert.ToDateTime(model.eDate); } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] OrderNo[" + model.OrdersNo + "] OrderName[" + model.OrderName + "] Orderdescription[" + model.OrderDescription + "] OrderDate[ " + model.Orderdate + " ] DeliveryDate[ " + model.deliverydate + " ] TotalCost [ " + model.TotalCost + " ] OrdersType [ " + model.ClientId + "] VendoeId [ " + model.venorld + " ] FiscalId [ " + model.FiscalYearld + "] eDate [ " + model.eDate + " ]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MTransaction model) { Common.Logger l = new Common.Logger(); string ClassName = "CTransaction"; try { var query = from o in obj.Transactions where Convert.ToString(o.id) == model.id select o; foreach (var item in query) { item.id = int.Parse(model.id); item.TransactionDetails = model.TransactionDetails; item.TransactionType = model.TransactionType; item.OrderId = int.Parse(model.OrderId); item.ClientId = int.Parse(model.ClientId); item.VendorId = int.Parse(model.VendorId); item.FiscalYearId = int.Parse(model.FiscalYearId); item.eDate = Convert.ToDateTime(model.eDate); } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] TransactionDetail[" + model.TransactionDetails + "] TransactionType[" + model.TransactionType + "] OrderId[" + model.OrderId + "] ClientId[ " + model.ClientId + " ] VendorId[ " + model.VendorId + " ] FiscalYearId[ " + model.FiscalYearId + " ] eDate [ " + model.eDate + " ]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Update(Models.MsaleTypes model) { Common.Logger l = new Common.Logger(); string ClassName = "CSalesType"; try { var query = from o in obj.SaleTypes where Convert.ToString(o.id) == model.id select o; foreach (var item in query) { item.id = int.Parse(model.id); item.name = model.name; } l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] name[" + model.name + "]"); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Updated Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }
public int Save(Models.MPayments model) { Common.Logger l = new Common.Logger(); string ClassName = "CPayment"; try { DB.Payment bs = new DB.Payment(); bs.ClientId = Convert.ToInt32(model.ClientId); bs.VendorId = model.VendorId; bs.OrderId = model.OrderId; bs.TransactionId = model.TransactionId; bs.Paid = model.Paid; bs.TotalCost = model.TotalCost; bs.PaymentType = model.PaymentType; bs.PaymentState = model.Paymentstate; l.Print(ClassName, Common.LogPointer.Info.ToString(), "Model Values id[" + model.id + "] ClientId[" + model.ClientId + "] VendorId[" + model.VendorId + "] OrderId[" + model.OrderId + "] TransactionId [ " + model.TransactionId + "] Paid [ " + model.Paid + " ] PaymentType[ " + model.PaymentType + " ] PaymentState [ " + model.Paymentstate + " ]"); obj.Payments.InsertOnSubmit(bs); obj.SubmitChanges(); l.Print(ClassName, Common.LogPointer.Info.ToString(), "Record Inserted Successfully"); return(1); } catch (Exception ex) { l.Print(ClassName, Common.LogPointer.Error.ToString(), ex.ToString()); return(-1); } }