예제 #1
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         if (RInvoice != 0)
         {
             Tbl_SaleRecovery objRec2 = new Tbl_SaleRecovery()
             {
                 CustomerID   = CustomerID,
                 RecoveryDate = RecoveryDate,
                 ReturnCash   = ReturnCash,
                 RInvoice     = RInvoice,
             };
             context.Tbl_SaleRecovery.Add(objRec2);
             context.SaveChanges();
         }
         else
         {
             Tbl_SaleRecovery objRec = new Tbl_SaleRecovery()
             {
                 CustomerID   = CustomerID,
                 RecoveryDate = RecoveryDate,
                 ReturnCash   = ReturnCash
             };
             context.Tbl_SaleRecovery.Add(objRec);
             context.SaveChanges();
         }
     }
 }
 public void SaveDetail()
 {
     using (var context = new CashCarryEntities3())
     {
         if (frieght != 0)
         {
             Tbl_PurchaseDetail objpur = new Tbl_PurchaseDetail()
             {
                 PInvoice      = PInvoice,
                 ProductID     = ProductID,
                 Quantity      = Quantity,
                 TotalAmount   = Amount,
                 Ctn           = Ctn,
                 frieght       = frieght,
                 PurchasePrice = TP
             };
             context.Tbl_PurchaseDetail.Add(objpur);
             context.SaveChanges();
         }
         else
         {
             Tbl_PurchaseDetail objpur = new Tbl_PurchaseDetail()
             {
                 PInvoice    = PInvoice,
                 ProductID   = ProductID,
                 Quantity    = Quantity,
                 TotalAmount = Amount,
                 Ctn         = Ctn,
                 frieght     = 0
             };
             context.Tbl_PurchaseDetail.Add(objpur);
             context.SaveChanges();
         }
     }
 }
예제 #3
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         if (PReturnID != 0)
         {
             tbl_PurchaseRemain objPur = new tbl_PurchaseRemain()
             {
                 CompanyID  = CompanyID,
                 PReturnID  = PReturnID,
                 Date       = Date,
                 ReturnCash = ReturnCash
             };
             context.tbl_PurchaseRemain.Add(objPur);
             context.SaveChanges();
         }
         else
         {
             tbl_PurchaseRemain obj = new tbl_PurchaseRemain()
             {
                 CompanyID  = CompanyID,
                 Date       = Date,
                 ReturnCash = ReturnCash
             };
             context.tbl_PurchaseRemain.Add(obj);
             context.SaveChanges();
         }
     }
 }
예제 #4
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         if (Status == true)
         {
             tbl_Employee_Salary objemp = new tbl_Employee_Salary()
             {
                 EmployeeID = EmployeeID,
                 Salary     = Salary,
                 SalaryDate = SalaryDate,
                 Status     = Status
             };
             context.tbl_Employee_Salary.Add(objemp);
             context.SaveChanges();
         }
         else
         {
             tbl_Employee_Salary objemp = new tbl_Employee_Salary()
             {
                 EmployeeID = EmployeeID,
                 ResginDate = ResignDate,
                 Salary     = Salary,
                 SalaryDate = SalaryDate,
                 Status     = Status
             };
             context.tbl_Employee_Salary.Add(objemp);
             context.SaveChanges();
         }
     }
 }
예제 #5
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         if (Username == null && Password == null && LoginType == 0)
         {
             tbl_employee objemp = new tbl_employee()
             {
                 Name         = Name,
                 Fname        = Fname,
                 Gender       = Gender,
                 Password     = null,
                 Qualifiction = Qualifiction,
                 Username     = null,
                 DOB          = DOB,
                 Designation  = Designation,
                 Contact      = Contact,
                 Cnic         = Cnic,
                 Address      = Address,
                 AsignDate    = AsignDate,
                 Salary       = Salary,
                 LoginTypeID  = 0
             };
             context.tbl_employee.Add(objemp);
             context.SaveChanges();
         }
         else
         {
             tbl_employee objemp = new tbl_employee()
             {
                 Name         = Name,
                 Fname        = Fname,
                 Gender       = Gender,
                 Password     = Password,
                 Qualifiction = Qualifiction,
                 Username     = Username,
                 DOB          = DOB,
                 Designation  = Designation,
                 Contact      = Contact,
                 Cnic         = Cnic,
                 Address      = Address,
                 AsignDate    = AsignDate,
                 Salary       = Salary,
                 LoginTypeID  = LoginType
             };
             context.tbl_employee.Add(objemp);
             context.SaveChanges();
         }
     }
 }
예제 #6
0
        public void Save()
        {
            using (var context = new CashCarryEntities3())
            {
                tbl_Customer objCus = new tbl_Customer();

                if (objCus.DuePayment != 0)
                {
                    objCus.Name       = Name;
                    objCus.CusTypeID  = CusTypeID;
                    objCus.Address    = Address;
                    objCus.Contact    = Contact;
                    objCus.Email      = Email;
                    objCus.ZoneID     = ZoneID;
                    objCus.DuePayment = Duepayment;
                    objCus.SubRouteId = SubZoneId;
                }


                else
                {
                    objCus.Name       = Name;
                    objCus.CusTypeID  = CusTypeID;
                    objCus.Address    = Address;
                    objCus.Contact    = Contact;
                    objCus.Email      = Email;
                    objCus.ZoneID     = ZoneID;
                    objCus.DuePayment = 0;
                    objCus.SubRouteId = SubZoneId;
                }
                context.tbl_Customer.Add(objCus);
                context.SaveChanges();
            }
        }
예제 #7
0
 public void Update()
 {
     using (var context = new CashCarryEntities3())
     {
         var result = context.tbl_employee.Where(a => a.EmployeeID == EmployeeID).SingleOrDefault();
         if (result != null)
         {
             result.Name         = Name;
             result.Fname        = Fname;
             result.Gender       = Gender;
             result.Password     = Password;
             result.Qualifiction = Qualifiction;
             result.Username     = Username;
             result.DOB          = DOB;
             result.Designation  = Designation;
             result.Contact      = Contact;
             result.Cnic         = Cnic;
             result.Address      = Address;
             result.Salary       = Salary;
             result.AsignDate    = AsignDate;
             context.SaveChanges();
         }
         ;
     }
 }
예제 #8
0
 public void Delete()
 {
     using (var context = new CashCarryEntities3())
     {
         var result = context.tbl_Company.Where(a => a.CompanyID == CompanyID).SingleOrDefault();
         context.tbl_Company.Remove(result);
         context.SaveChanges();
     }
 }
예제 #9
0
 public void Update()
 {
     using (var context = new CashCarryEntities3())
     {
         var result = context.tbl_CustomerTypes.Where(a => a.CusTypeID == CusTypeID).SingleOrDefault();
         if (result != null)
         {
             result.CusType = CusType;
             context.SaveChanges();
         }
     }
 }
예제 #10
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         tbl_Zone obj = new tbl_Zone()
         {
             ZoneName = ZoneName
         };
         context.tbl_Zone.Add(obj);
         context.SaveChanges();
     }
 }
예제 #11
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         tbl_Category objCate = new tbl_Category()
         {
             CategoryName = CategoryName
         };
         context.tbl_Category.Add(objCate);
         context.SaveChanges();
     }
 }
예제 #12
0
 public void Delete()
 {
     using (var context = new CashCarryEntities3())
     {
         var result = context.tbl_Customer.Where(a => a.CustomerID == CustomerID).SingleOrDefault();
         if (result != null)
         {
             context.tbl_Customer.Remove(result);
             context.SaveChanges();
         }
     }
 }
예제 #13
0
 public void Update()
 {
     using (var context = new CashCarryEntities3())
     {
         var result = context.tbl_Zone.Where(a => a.ZoneID == ZoneId).SingleOrDefault();
         if (result != null)
         {
             result.ZoneName = ZoneName;
             context.SaveChanges();
         }
     }
 }
예제 #14
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         tbl_CustomerTypes objCus = new tbl_CustomerTypes()
         {
             CusType = CusType
         };
         context.tbl_CustomerTypes.Add(objCus);
         context.SaveChanges();
     }
 }
예제 #15
0
 public void Delete()
 {
     using (var context = new CashCarryEntities3())
     {
         var result = context.tbl_ProductPrice.Where(a => a.ProductPriceId == ProductPriceId).SingleOrDefault();
         if (result != null)
         {
             context.tbl_ProductPrice.Remove(result);
             context.SaveChanges();
         }
     }
 }
예제 #16
0
        //public void Delete()
        //{
        //   using(var context=new CashCarryEntities3())
        //   {
        //       var result = context.tbl_Category.Where(a => a.CategoryID == CategoryID).SingleOrDefault();
        //       if(result != null)
        //       {
        //           context.tbl_Category.Remove(result);
        //           context.SaveChanges();
        //       }
        //   }
        //}

        public void Update()
        {
            using (var context = new CashCarryEntities3())
            {
                var result = context.tbl_Category.Where(m => m.CategoryID == CategoryID).SingleOrDefault();
                if (result != null)
                {
                    result.CategoryName = CategoryName;
                    context.SaveChanges();
                }
            }
        }
예제 #17
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         Tbl_SubZone obj = new Tbl_SubZone()
         {
             SubRouteName = SubRouteName,
             ZoneID       = ZoneID
         };
         context.Tbl_SubZone.Add(obj);
         context.SaveChanges();
     }
 }
예제 #18
0
 public bool UpdateBalance(decimal amount, int CompanyID)
 {
     using (var context = new CashCarryEntities3())
     {
         var customer = context.tbl_Company.Where(m => m.CompanyID == CompanyID).FirstOrDefault();
         if (customer != null)
         {
             customer.DuePayment = amount;
         }
         context.SaveChanges();
         return(true);
     }
 }
예제 #19
0
 public void Update()
 {
     using (var context = new CashCarryEntities3())
     {
         var result = context.tbl_ProductPrice.Where(a => a.ProductPriceId == ProductPriceId).SingleOrDefault();
         if (result != null)
         {
             IsActive    = IsActive;
             SellerPrice = SellerPrice;
             BuyerPrice  = BuyerPrice;
             context.SaveChanges();
         }
     }
 }
예제 #20
0
        public void Update()
        {
            using (var context = new CashCarryEntities3())
            {
                var result = context.tbl_Product.Where(a => a.ProductID == ProductID).SingleOrDefault();
                if (result != null)
                {
                    result.ProductName = ProductName;
                    result.weight      = weight;

                    result.PiecePerCtn = PiecePerCtn;
                    context.SaveChanges();
                }
            }
        }
예제 #21
0
 public void Update()
 {
     using (var context = new CashCarryEntities3())
     {
         var result = context.tbl_Company.Where(a => a.CompanyID == CompanyID).SingleOrDefault();
         if (result != null)
         {
             result.CompanyName = CompanyName;
             result.Contact     = Contact;
             result.Email       = Email;
             result.Address     = Address;
             context.SaveChanges();
         }
     }
 }
예제 #22
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         tbl_ProductPrice objPrice = new tbl_ProductPrice()
         {
             ProductID   = ProductID,
             BuyerPrice  = BuyerPrice,
             SellerPrice = SellerPrice,
             IsActive    = IsActive,
             AddedDate   = AddedDate
         };
         context.tbl_ProductPrice.Add(objPrice);
         context.SaveChanges();
     }
 }
예제 #23
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         tbl_Company obj = new tbl_Company()
         {
             CompanyName = CompanyName,
             Contact     = Contact,
             Email       = Email,
             Address     = Address,
             DuePayment  = DuePayment
         };
         context.tbl_Company.Add(obj);
         context.SaveChanges();
     }
 }
예제 #24
0
 public void SaveMaster()
 {
     using (var context = new CashCarryEntities3())
     {
         Tbl_ReturnSaleMaster objMas = new Tbl_ReturnSaleMaster()
         {
             ReturnAmount = ReturnAmount,
             ReturnDate   = ReturnDate,
             Invoice_     = Invoiceno,
             ReturnCash   = ReturnCash,
             TotalBill    = TotalBill
         };
         context.Tbl_ReturnSaleMaster.Add(objMas);
         context.SaveChanges();
     }
 }
예제 #25
0
 public void Save()
 {
     using (var context = new CashCarryEntities3())
     {
         tbl_Expense objExp = new tbl_Expense()
         {
             ExType      = ExType,
             ExName      = ExName,
             Description = Description,
             Date        = Date,
             Amount      = Amount
         };
         context.tbl_Expense.Add(objExp);
         context.SaveChanges();
     }
 }
예제 #26
0
 public void SaveDetail()
 {
     using (var context = new CashCarryEntities3())
     {
         Tbl_PurchaseReturn_Detail objDetail = new Tbl_PurchaseReturn_Detail()
         {
             PReturnID     = PReturnID,
             ProductID     = ProductID,
             Quantity      = Quantity,
             Amount        = Amount,
             Ctn           = Ctn,
             PurchasePrice = TP
         };
         context.Tbl_PurchaseReturn_Detail.Add(objDetail);
         context.SaveChanges();
     }
 }
예제 #27
0
 public void Update()
 {
     using (var context = new CashCarryEntities3())
     {
         var result = context.tbl_Customer.Where(a => a.CustomerID == CustomerID).SingleOrDefault();
         if (result != null)
         {
             result.Name      = Name;
             result.CusTypeID = CusTypeID;
             result.Address   = Address;
             result.Contact   = Contact;
             result.Email     = Email;
             // result.ZoneID = ZoneID;
             context.SaveChanges();
         }
     }
 }
예제 #28
0
 public void  SaveDetail()
 {
     using (var context = new CashCarryEntities3())
     {
         Tbl_ReturnSaleDetail objRet = new Tbl_ReturnSaleDetail()
         {
             RInvoice    = RInvoice,
             ProductID   = ProductID,
             Quantity    = Quantity,
             Ctn         = Ctn,
             Discount    = Discount,
             Amount      = Amount,
             RetailPrice = RP
         };
         context.Tbl_ReturnSaleDetail.Add(objRet);
         context.SaveChanges();
     }
 }
예제 #29
0
 public void SaveMaster()
 {
     using (var context = new CashCarryEntities3())
     {
         tbl_SaleMAster objMas = new tbl_SaleMAster()
         {
             SaleDate    = SaleDate,
             CustomerID  = CustomerID,
             TotalAmount = GrandTotal,
             Payment     = Payment,
             DuePayment  = DuePayment,
             OrderBy     = OrderBy,
             ProfitLoss  = MasterProfit
         };
         context.tbl_SaleMAster.Add(objMas);
         context.SaveChanges();
     }
 }
예제 #30
0
 public void SaveDetail()
 {
     using (var context = new CashCarryEntities3())
     {
         tbl_Saledetail objsale = new tbl_Saledetail()
         {
             Invoice_    = InvoiceNo,
             ProductID   = ProductID,
             Discount    = Discount,
             Quantity    = Quantity,
             Ctn         = Ctn,
             TotalAmount = TotalAmount,
             ProfitLoss  = DetailProfit,
             RetailPrice = RP
         };
         context.tbl_Saledetail.Add(objsale);
         context.SaveChanges();
     }
 }