public static int EditPayment(Payments payment) { using (eLawyerEntities ele = new eLawyerEntities()) { Payments oldPayment = ele.Payments.FirstOrDefault(p => p.Id == payment.Id); if (oldPayment != null) { //oldPayment.ClientId=payment.ClientId oldPayment.CaseId = payment.CaseId; oldPayment.PaidTo = payment.PaidTo; oldPayment.ExpenseHeadId = payment.ExpenseHeadId; oldPayment.PaymentModeId = payment.PaymentModeId; oldPayment.Date = payment.Date; oldPayment.CHQ_DATE = payment.CHQ_DATE; oldPayment.CHQ_NO = payment.CHQ_NO; oldPayment.Amounts = payment.Amounts; oldPayment.BANK = payment.BANK; oldPayment.Narration = payment.Narration; oldPayment.Remarks = payment.Remarks; return(ele.SaveChanges()); } return(0); } }
public static EXPENSESHEAD GetLedgerDetailsByLedgerId(int expId) { using (eLawyerEntities deo = new eLawyerEntities()) { return(deo.EXPENSESHEAD.FirstOrDefault(exp => exp.Id == expId)); } }
public static SelectList GetYesNoList() { try { using (eLawyerEntities islObject = new eLawyerEntities()) { List <SelectListItem> YesNoList = new List <SelectListItem>(); SelectListItem li = new SelectListItem(); li.Value = "True"; li.Text = "Yes"; YesNoList.Add(li); SelectListItem li2 = new SelectListItem(); li2.Value = "False"; li2.Text = "No"; YesNoList.Add(li2); return(new SelectList(YesNoList, "Value", "Text")); } } catch { return(null); } }
public static vw_CaseLists GetCaseDetailsByCaseNumber(string caseNumber) { using (eLawyerEntities ele = new eLawyerEntities()) { return(ele.vw_CaseLists.FirstOrDefault(cs => caseNumber.Equals(cs.CaseNumber, StringComparison.OrdinalIgnoreCase))); } }
public static Cases GetCaseDetailsById(int id) { using (eLawyerEntities ele = new eLawyerEntities()) { return(ele.Cases.FirstOrDefault(cs => cs.ID == id)); } }
public static vw_CaseLists GetCaseDetailsByCaseId(int caseId) { using (eLawyerEntities ele = new eLawyerEntities()) { return(ele.vw_CaseLists.FirstOrDefault(cs => cs.ID == caseId)); } }
public static int UpdateClient(int id, Clients client) { try { using (eLawyerEntities ve = new eLawyerEntities()) { Clients updated = ve.Clients.FirstOrDefault(cl => cl.Id == id); if (updated != null) { updated.Name = client.Name; updated.Lane = client.Lane; updated.Street = client.Street; updated.City = client.City; updated.StateId = client.StateId; updated.Zip = client.Zip; updated.Phone1 = client.Phone1; updated.Phone2 = client.Phone2; updated.Cell = client.Cell; updated.Email = client.Email; updated.Website = client.Website; updated.LastUpdated = DateTime.Now; updated.Logo = client.Logo; updated.ContentType = updated.ContentType; updated.ContractStartDate = client.ContractStartDate; updated.ContractEndDate = client.ContractEndDate; return(ve.SaveChanges()); } } } catch { return(0); } return(0); }
public static int UpdateCaseinfo(Cases currentCase) { using (eLawyerEntities ele = new eLawyerEntities()) { Cases oldCase = ele.Cases.FirstOrDefault(cs => currentCase.CaseNumber.Equals(cs.CaseNumber, StringComparison.OrdinalIgnoreCase)); if (oldCase != null) { oldCase.CourtName = currentCase.CourtName; oldCase.EnrollmentDate = currentCase.EnrollmentDate; oldCase.FirstHearingDate = currentCase.FirstHearingDate; oldCase.FirstParty = currentCase.FirstParty; oldCase.FirstPartyAddress = currentCase.FirstPartyAddress; oldCase.FirstPartyPhone = currentCase.FirstPartyPhone; oldCase.SecondParty = currentCase.SecondParty; oldCase.SecondPartyAddress = currentCase.SecondPartyAddress; oldCase.SecondPartyPhone = currentCase.SecondPartyPhone; oldCase.Status = currentCase.Status; oldCase.NextDate = currentCase.NextDate; oldCase.LastUpdated = currentCase.LastUpdated; oldCase.IsFromFirstParty = currentCase.IsFromFirstParty; oldCase.IsFromSecondParty = currentCase.IsFromSecondParty; oldCase.MyPartyName = currentCase.MyPartyName; oldCase.MyPartyPhone = currentCase.MyPartyPhone; oldCase.Description = currentCase.Description; return(ele.SaveChanges()); } return(0); } }
public static List <CaseHearings> GetCaseHearingListByCaseId(int id) { using (eLawyerEntities ele = new eLawyerEntities()) { return(ele.CaseHearings.Where(ch => ch.CaseId == id && ch.IsDeleted == null).ToList()); } }
public static CaseHearings GetCaseHearingById(int id) { using (eLawyerEntities ele = new eLawyerEntities()) { return(ele.CaseHearings.FirstOrDefault(ch => ch.ID == id && ch.IsDeleted == null)); } }
public static List <vw_ExpenseHeads> GetLedgerMasterList() { using (eLawyerEntities deo = new eLawyerEntities()) { return((from ledger in deo.vw_ExpenseHeads select ledger).OrderBy(ld => ld.LedgerType).ToList()); } }
public static List <vw_PaymentLists> GetPaymentList(int clinetId, int paymentType) { using (eLawyerEntities deo = new eLawyerEntities()) { return((from payment in deo.vw_PaymentLists where payment.ClientId == clinetId && payment.LedgerTypeId == paymentType select payment).ToList()); } }
public static int IndiaCountryCode = GetDefaultCountryCode(); //for India; public static int GetDefaultCountryCode() { using (eLawyerEntities islObject = new eLawyerEntities()) { int defaultCountryCode = 0; defaultCountryCode = islObject.Countries.FirstOrDefault(cn => cn.Name == "India").Id; return(defaultCountryCode); } }
public static int CreatePayment(Payments payment) { using (eLawyerEntities deo = new eLawyerEntities()) { if (payment != null) { deo.AddToPayments(payment); return(deo.SaveChanges()); } } return(0); }
public static int AddPayment(Payments newPayments) { using (eLawyerEntities ele = new eLawyerEntities()) { if (newPayments != null) { ele.AddToPayments(newPayments); return(ele.SaveChanges()); } return(0); } }
public static int DeleteCaseHearingById(int id) { using (eLawyerEntities ele = new eLawyerEntities()) { CaseHearings oldCaseHearing = ele.CaseHearings.FirstOrDefault(cs => cs.ID == id); if (oldCaseHearing != null) { oldCaseHearing.IsDeleted = true; return(ele.SaveChanges()); } return(0); } }
public static int UpdateCaseHearing(CaseHearings caseHearing) { using (eLawyerEntities ele = new eLawyerEntities()) { CaseHearings oldStudent = ele.CaseHearings.FirstOrDefault(st => st.ID == caseHearing.ID); if (oldStudent == null) { return(-1);//Student record not found. } var updatedStudents = ele.ApplyCurrentValues(oldStudent.GetType().Name, caseHearing); return(ele.SaveChanges()); } }
public static List <vw_CaseLists> GetCaseAlerts(DateTime fromdate, DateTime toDate, int?clientId) { using (eLawyerEntities ele = new eLawyerEntities()) { if (clientId == null) { return(ele.vw_CaseLists.Where(cs => cs.IsDeleted == null && cs.NextDate.Value >= fromdate.Date && cs.NextDate.Value <= toDate.Date).ToList()); } else { return(ele.vw_CaseLists.Where(cs => cs.IsDeleted == null && cs.ClientId == (int)clientId && cs.NextDate.Value >= fromdate.Date && cs.NextDate.Value <= toDate.Date).ToList()); } } }
/// <summary> /// returns cases list for given client, otherwise returns all case list /// </summary> /// <param name="clientId"></param> /// <returns></returns> public static List <vw_CaseLists> GetCaseList(int?clientId) { using (eLawyerEntities ele = new eLawyerEntities()) { if (clientId == null) { return(ele.vw_CaseLists.Where(cs => cs.IsDeleted == null).ToList()); } else { return(ele.vw_CaseLists.Where(cs => cs.IsDeleted == null && cs.ClientId == (int)clientId).ToList()); } } }
public static vw_ClientList GetClientDetailsById(int clientId) { try { using (eLawyerEntities ve = new eLawyerEntities()) { return(ve.vw_ClientList.FirstOrDefault(cl => cl.Id == clientId)); } } catch { return(null); } }
public static Clients GetClientById(int clientId) { try { using (eLawyerEntities ve = new eLawyerEntities()) { return(ve.Clients.FirstOrDefault(cl => cl.Id == clientId)); } } catch { return(null); } }
public static int CreateNewCaseHearing(CaseHearings newHearing) { try { using (eLawyerEntities ele = new eLawyerEntities()) { ele.AddToCaseHearings(newHearing); return(ele.SaveChanges()); } } catch { return(0); } }
public static int CreateClient(Clients client) { try { using (eLawyerEntities ve = new eLawyerEntities()) { ve.AddToClients(client); return(ve.SaveChanges()); } } catch (Exception) { return(0); } }
/// <summary> /// Enroll New Case /// </summary> /// <param name="newCase"></param> /// <returns></returns> public static int EnrollNewCase(Cases newCase) { using (eLawyerEntities ele = new eLawyerEntities()) { Cases oldCase = ele.Cases.FirstOrDefault(cs => newCase.CaseNumber.Equals(cs.CaseNumber, StringComparison.OrdinalIgnoreCase)); if (oldCase == null) { newCase.CreatedDate = DateTime.Now.Date; newCase.LastUpdated = DateTime.Now.Date; newCase.IsActive = true; // intially a case will be assumed as a active case. ele.AddToCases(newCase); return(ele.SaveChanges()); } return(0); } }
public static List <vw_ClientList> GetClients() { try { using (eLawyerEntities ve = new eLawyerEntities()) { // Client List return((from clients in ve.vw_ClientList select clients).ToList()); } } catch { return(null); } }
public static int DeleteLedgerByLedgerId(int id) { using (eLawyerEntities islObject = new eLawyerEntities()) { Payments payment = islObject.Payments.FirstOrDefault(pmt => pmt.ExpenseHeadId == id); if (payment == null) { EXPENSESHEAD ledger = islObject.EXPENSESHEAD.FirstOrDefault(rk => rk.Id == id); if (ledger != null) { islObject.DeleteObject(ledger); return(islObject.SaveChanges()); } } return(0); } }
public static SelectList GetCountryList() { try { using (eLawyerEntities islObject = new eLawyerEntities()) { // List of all coutries List <CountryNameList> countryList = (from country in islObject.Countries select new CountryNameList { CountryId = country.Id, Name = country.Name }).ToList(); return(new SelectList(countryList, "CountryId", "Name", IndiaCountryCode)); } } catch { return(null); } }
public static SelectList GetCaseNatureNameList(int selectedId = 0) { try { using (eLawyerEntities islObject = new eLawyerEntities()) { List <CaseNatureNameList> caseNatureList = new List <CaseNatureNameList>(); // List of all LegderTypes caseNatureList = (from caseNature in islObject.CaseNatures select new CaseNatureNameList { Id = caseNature.Id, Nature = caseNature.Nature }).ToList(); return(new SelectList(caseNatureList, "Id", "Nature", selectedId)); } } catch { return(null); } }
public static SelectList GetPaymentHeadsNameList() { try { using (eLawyerEntities islObject = new eLawyerEntities()) { // List of all Batchs List <PaymentHeadNames> headList = (from head in islObject.PaymentHeads select new PaymentHeadNames { Id = head.Id, Name = head.PaymentHead }).ToList(); return(new SelectList(headList, "Id", "Name")); } } catch { return(null); } }
public static SelectList GetPaymentModesNameList() { try { using (eLawyerEntities islObject = new eLawyerEntities()) { // List of all Batchs List <PaymentModeNames> modeList = (from mode in islObject.PaymentModes select new PaymentModeNames { Id = mode.Id, Name = mode.Mode }).ToList(); return(new SelectList(modeList, "Id", "Name")); } } catch { return(null); } }