コード例 #1
0
 public static int SaveChallanEntry(tblChallanEntryDTO tblChallanEntryDTO)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblChallanEntryObject = tblChallanEntryDTO.ToEntity();
         if (tblChallanEntryDTO.ChallanEntryNo == 0)
         {
             dbObject.tblChallanEntries.Add(tblChallanEntryObject);
         }
         else
         {
             tblChallanEntryObject                   = dbObject.tblChallanEntries.Find(tblChallanEntryDTO.ChallanEntryNo);
             tblChallanEntryObject.ChallanId         = tblChallanEntryDTO.ChallanId;
             tblChallanEntryObject.ChallanId         = tblChallanEntryDTO.ChallanId;
             tblChallanEntryObject.BkgStnCode        = tblChallanEntryDTO.BkgStnCode;
             tblChallanEntryObject.CNNoWithAlphaCode = tblChallanEntryDTO.CNNoWithAlphaCode;
             tblChallanEntryObject.PackagesNos       = tblChallanEntryDTO.PackagesNos;
             tblChallanEntryObject.PackagesMethod    = tblChallanEntryDTO.PackagesMethod;
             tblChallanEntryObject.SaidToContain     = tblChallanEntryDTO.SaidToContain;
             tblChallanEntryObject.ActualWeightKgs   = tblChallanEntryDTO.ActualWeightKgs;
             tblChallanEntryObject.DestinationName   = tblChallanEntryDTO.DestinationName;
         }
         dbObject.SaveChanges();
         return(tblChallanEntryObject.ChallanEntryNo);
     }
 }
コード例 #2
0
 public static int Save(tblMRNoteDTO tblMRNoteDTO)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblMRNote = tblMRNoteDTO.ToEntity();
         if (tblMRNoteDTO.MRId == 0)
         {
             dbObject.tblMRNotes.Add(tblMRNote);
         }
         else
         {
             tblMRNote                = dbObject.tblMRNotes.Find(tblMRNoteDTO.MRId);
             tblMRNote.MrNo           = tblMRNoteDTO.MrNo;
             tblMRNote.BillId         = tblMRNoteDTO.BillId;
             tblMRNote.MRDate         = tblMRNoteDTO.MRDate;
             tblMRNote.RecievedFrom   = tblMRNoteDTO.RecievedFrom;
             tblMRNote.LocationFrom   = tblMRNoteDTO.LocationFrom;
             tblMRNote.LocationTo     = tblMRNoteDTO.LocationTo;
             tblMRNote.NoofPackages   = tblMRNoteDTO.NoofPackages;
             tblMRNote.Weight         = tblMRNoteDTO.Weight;
             tblMRNote.AmountRecieved = tblMRNoteDTO.AmountRecieved;
             tblMRNote.WayOfRecieve   = tblMRNoteDTO.WayOfRecieve;
             tblMRNote.Fright         = tblMRNoteDTO.Fright;
             tblMRNote.StCharges      = tblMRNoteDTO.StCharges;
             tblMRNote.Hamali         = tblMRNoteDTO.Hamali;
             tblMRNote.Other1         = tblMRNoteDTO.Other1;
             tblMRNote.Other2         = tblMRNoteDTO.Other2;
             tblMRNote.Other3         = tblMRNoteDTO.Other3;
             tblMRNote.Other4         = tblMRNoteDTO.Other4;
             tblMRNote.TotalAmount    = tblMRNoteDTO.TotalAmount;
         }
         dbObject.SaveChanges();
         return(tblMRNote.MRId);
     }
 }
コード例 #3
0
 public static tblMRNoteDTO Get(int mrId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblMRNotes.Find(mrId).ToDTO());
     }
 }
コード例 #4
0
 public static List <tblMRNoteDTO> GetBillMRNote(int billId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblMRNotes.Where(mrNOte => mrNOte.BillId == billId).ToList().ToDTOs());
     }
 }
コード例 #5
0
 public static int Save(tblAccountsMasterDTO tblAccountsMasterDTO)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblAccountsMaster = tblAccountsMasterDTO.ToEntity();
         if (tblAccountsMasterDTO.AccountId == 0)
         {
             dbObject.tblAccountsMasters.Add(tblAccountsMaster);
         }
         else
         {
             tblAccountsMaster                = dbObject.tblAccountsMasters.Find(tblAccountsMasterDTO.AccountId);
             tblAccountsMaster.AccountName    = tblAccountsMasterDTO.AccountName;
             tblAccountsMaster.AccountType    = tblAccountsMasterDTO.AccountType;
             tblAccountsMaster.AccountNo      = tblAccountsMasterDTO.AccountNo;
             tblAccountsMaster.Addrees        = tblAccountsMasterDTO.Addrees;
             tblAccountsMaster.PhoneNo        = tblAccountsMasterDTO.PhoneNo;
             tblAccountsMaster.OpeningBalance = tblAccountsMasterDTO.OpeningBalance;
             tblAccountsMaster.OpeningDate    = tblAccountsMasterDTO.OpeningDate;
             tblAccountsMaster.Description    = tblAccountsMasterDTO.Description;
         }
         dbObject.SaveChanges();
         return(tblAccountsMaster.AccountId);
     }
 }
コード例 #6
0
 public static int SaveBillEntry(tblBillEntryDTO tblBillEntryDTO)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblBillEntryObject = tblBillEntryDTO.ToEntity();
         if (tblBillEntryDTO.BillOrderId == 0)
         {
             dbObject.tblBillEntries.Add(tblBillEntryObject);
         }
         else
         {
             tblBillEntryObject                  = dbObject.tblBillEntries.Find(tblBillEntryDTO.BillOrderId);
             tblBillEntryObject.BillId           = tblBillEntryDTO.BillId;
             tblBillEntryObject.BookingOldBrCode = tblBillEntryDTO.BookingOldBrCode;
             tblBillEntryObject.OldBillNo        = tblBillEntryDTO.OldBillNo;
             tblBillEntryObject.OldBillDate      = tblBillEntryDTO.OldBillDate;
             tblBillEntryObject.DestnCode        = tblBillEntryDTO.DestnCode;
             tblBillEntryObject.Particulars      = tblBillEntryDTO.Particulars;
             tblBillEntryObject.ChargedWeight    = tblBillEntryDTO.ChargedWeight;
             tblBillEntryObject.Rate             = tblBillEntryDTO.Rate;
             tblBillEntryObject.Amount           = tblBillEntryDTO.Amount;
         }
         dbObject.SaveChanges();
         return(tblBillEntryObject.BillOrderId);
     }
 }
コード例 #7
0
 public static tblConsigneeDTO Get(int consigneeId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblConsignees.Find(consigneeId).ToDTO());
     }
 }
コード例 #8
0
 public static tblBillEntryDTO GetBillEntry(int billOrderId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblBillEntries.Find(billOrderId).ToDTO());
     }
 }
コード例 #9
0
 public static List <tblBillEntryDTO> GetBillEntryList(int billId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblBillEntries.Where(billEntry => billEntry.BillId == billId).ToDTOs());
     }
 }
コード例 #10
0
 public static List <tblConsignmentNoteDTO> GetAll()
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblConsignmentNotes.ToList().ToDTOs());
     }
 }
コード例 #11
0
 public static tblAccountsMasterDTO Get(int companyId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblAccountsMasters.Find(companyId).ToDTO());
     }
 }
コード例 #12
0
 public static tblChallanEntryDTO GetChallanEntry(int ChallanOrderId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblChallanEntries.Find(ChallanOrderId).ToDTO());
     }
 }
コード例 #13
0
 public static List <tblAccountsMasterDTO> GetAll()
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblAccountsMasters.ToList().ToDTOs());
     }
 }
コード例 #14
0
 public static List <tblChallanDTO> GetAll()
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblChallans.ToList().ToDTOs());
     }
 }
コード例 #15
0
 public static List <tblChallanEntryDTO> GetChallanEntryList(int ChallanId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         return(dbObject.tblChallanEntries.Where(ChallanEntry => ChallanEntry.ChallanId == ChallanId).ToDTOs());
     }
 }
コード例 #16
0
 public static int Save(tblTransactionDTO tblTransactionDTO)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblTransaction = tblTransactionDTO.ToEntity();
         if (tblTransactionDTO.TransactionId == 0)
         {
             dbObject.tblTransactions.Add(tblTransaction);
         }
         else
         {
             tblTransaction             = dbObject.tblTransactions.Find(tblTransactionDTO.TransactionId);
             tblTransaction.AccountId   = tblTransactionDTO.AccountId;
             tblTransaction.TDate       = tblTransactionDTO.TDate;
             tblTransaction.DrAmount    = tblTransactionDTO.DrAmount;
             tblTransaction.CrAmount    = tblTransactionDTO.CrAmount;
             tblTransaction.Recievedby  = tblTransactionDTO.Recievedby;
             tblTransaction.PaidBy      = tblTransactionDTO.PaidBy;
             tblTransaction.Description = tblTransactionDTO.Description;
             tblTransaction.ChequeNo    = tblTransactionDTO.ChequeNo;
             tblTransaction.ChequeDate  = tblTransactionDTO.ChequeDate;
         }
         dbObject.SaveChanges();
         return(tblTransaction.TransactionId);
     }
 }
コード例 #17
0
 public static bool Delete(int consigneeId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblConsignee = dbObject.tblConsignees.Find(consigneeId);
         dbObject.tblConsignees.Remove(tblConsignee);
         dbObject.SaveChanges();
         return(true);
     }
 }
コード例 #18
0
 public static bool Delete(int companyId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblAccountsMaster = dbObject.tblAccountsMasters.Find(companyId);
         dbObject.tblAccountsMasters.Remove(tblAccountsMaster);
         dbObject.SaveChanges();
         return(true);
     }
 }
コード例 #19
0
 public static bool Delete(int transactionId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblTransaction = dbObject.tblTransactions.Find(transactionId);
         dbObject.tblTransactions.Remove(tblTransaction);
         dbObject.SaveChanges();
         return(true);
     }
 }
コード例 #20
0
 public static bool Delete(int mrId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblMRNote = dbObject.tblMRNotes.Find(mrId);
         dbObject.tblMRNotes.Remove(tblMRNote);
         dbObject.SaveChanges();
         return(true);
     }
 }
コード例 #21
0
 public static bool DeleteChallanEntry(int ChallanEntryOrderId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblChallanEntry = dbObject.tblChallanEntries.Find(ChallanEntryOrderId);
         dbObject.tblChallanEntries.Remove(tblChallanEntry);
         dbObject.SaveChanges();
         return(true);
     }
 }
コード例 #22
0
 public static tblChallanDTO Get(int ChallanId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         tblChallanDTO temp;
         temp = dbObject.tblChallans.Find(ChallanId).ToDTO();
         temp.ChallanEntryList = dbObject.tblChallanEntries.Where(h => h.ChallanId == ChallanId).ToList().ToDTOs();
         return(temp);
     }
 }
コード例 #23
0
 public static tblBillDTO Get(int billId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         tblBillDTO temp = new tblBillDTO();
         temp = dbObject.tblBills.Find(billId).ToDTO();
         temp.BillEntryList = dbObject.tblBillEntries.Where(h => h.BillId == billId).ToList().ToDTOs();
         return(temp);
     }
 }
コード例 #24
0
 public static bool CheckDuplicateConsignmentNoteNo(int ConsignmentId, int ConsignmentNoteNo)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var ConsignmentNoteList = dbObject.tblConsignmentNotes.Where(s => s.ConsignmentNoteNo == ConsignmentNoteNo && s.ConsignmentId != ConsignmentId).ToList();
         if (ConsignmentNoteList.Count() > 0)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #25
0
 public static bool CheckDuplicateMRNo(int mrId, int mrNo)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var billList = dbObject.tblMRNotes.Where(s => s.MrNo == mrNo && s.MRId != mrId).ToList();
         if (billList.Count() > 0)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #26
0
 public static bool CheckDuplicateCodeExists(string code, Int32 consignorId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var consignorList = dbObject.tblConsignors.Where(s => s.Code == code && s.ConsignorId != consignorId).ToList();
         if (consignorList.Count() > 0)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #27
0
 public static bool CheckDuplicateAccount(string accountName, int accountId)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var accountsMastersList = dbObject.tblAccountsMasters.Where(s => string.Compare(s.AccountName, accountName, StringComparison.CurrentCultureIgnoreCase) == 0 && s.AccountId != accountId).ToList();
         if (accountsMastersList.Count() > 0)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #28
0
 public static bool CheckDuplicateChallanNo(int ChallanId, int ChallanNo)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var ChallanList = dbObject.tblChallans.Where(s => s.ChallanNo == ChallanNo && s.ChallanId != ChallanId).ToList();
         if (ChallanList.Count() > 0)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #29
0
 public static bool CheckDuplicateBillNo(int billId, int billNo)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var billList = dbObject.tblBills.Where(s => s.BillNo == billNo && s.BillId != billId).ToList();
         if (billList.Count() > 0)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #30
0
 public static int Save(tblBillDTO tblBillDTO)
 {
     using (var dbObject = new BRCTransportDBEntities())
     {
         var tblBillObject = tblBillDTO.ToEntity();
         if (tblBillDTO.BillId == 0)
         {
             dbObject.tblBills.Add(tblBillObject);
             if (tblBillDTO.BillEntryList != null)
             {
                 foreach (var billEntry in tblBillDTO.BillEntryList)
                 {
                     billEntry.BillId = tblBillDTO.BillId;
                     dbObject.tblBillEntries.Add(billEntry.ToEntity());
                 }
             }
         }
         else
         {
             tblBillObject                   = dbObject.tblBills.Find(tblBillDTO.BillId);
             tblBillObject.BillNo            = tblBillDTO.BillNo;
             tblBillObject.BillDate          = tblBillDTO.BillDate;
             tblBillObject.PartyId           = tblBillDTO.PartyId;
             tblBillObject.BranchCode        = tblBillDTO.BranchCode;
             tblBillObject.PaymentDueDate    = tblBillDTO.PaymentDueDate;
             tblBillObject.BillType          = tblBillDTO.BillType;
             tblBillObject.BasicOfChargesGC  = tblBillDTO.BasicOfChargesGC;
             tblBillObject.Enclosure         = tblBillDTO.Enclosure;
             tblBillObject.ServiceTaxThrough = tblBillDTO.ServiceTaxThrough;
             tblBillObject.CheckedBy         = tblBillDTO.CheckedBy;
             tblBillObject.GrandTotal        = tblBillDTO.GrandTotal;
             tblBillObject.ServiceTaxRegdNo  = tblBillDTO.ServiceTaxRegdNo;
             List <tblBillEntry> entry = new List <tblBillEntry>();
             entry = dbObject.tblBillEntries.Where(h => h.BillId == tblBillDTO.BillId).ToList();
             foreach (var item in entry)
             {
                 dbObject.tblBillEntries.Remove(item);
             }
             if (tblBillDTO.BillEntryList != null)
             {
                 foreach (var billEntry in tblBillDTO.BillEntryList)
                 {
                     billEntry.BillId = tblBillDTO.BillId;
                     dbObject.tblBillEntries.Add(billEntry.ToEntity());
                 }
             }
         }
         dbObject.SaveChanges();
         return(tblBillObject.BillId);
     }
 }