Ejemplo n.º 1
0
 public List <View_tbl_Product> SearchByComp()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_tbl_Product.Where(a => a.Company == Company).ToList());
     }
 }
Ejemplo n.º 2
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();
            }
        }
Ejemplo n.º 3
0
 public List <tbl_CustomerTypes> Select()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_CustomerTypes.ToList());
     }
 }
Ejemplo n.º 4
0
 public List <View_tbl_Customer> SearchByZone()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_tbl_Customer.Where(a => a.ZoneID == ZoneID).ToList());
     }
 }
Ejemplo n.º 5
0
 public List <View_tbl_Customer> Select()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_tbl_Customer.ToList());
     }
 }
Ejemplo n.º 6
0
 public List <tbl_Category> Search()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_Category.Where(a => a.CategoryID == CategoryID).ToList());
     }
 }
Ejemplo n.º 7
0
 public List <View_ProductPrice> Select()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_ProductPrice.ToList());
     }
 }
Ejemplo n.º 8
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();
         }
         ;
     }
 }
Ejemplo n.º 9
0
 public List <tbl_employee> Search()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_employee.Where(a => a.EmployeeID == EmployeeID).ToList());
     }
 }
Ejemplo n.º 10
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();
         }
     }
 }
Ejemplo n.º 11
0
 public List <View_PurLedger> search()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_PurLedger.Where(m => m.CompanyID == CompanyID).ToList());
     }
 }
Ejemplo n.º 12
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();
         }
     }
 }
Ejemplo n.º 13
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();
         }
     }
 }
Ejemplo n.º 14
0
 public List <View_tbl_Product> SearchByProName()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_tbl_Product.Where(a => a.ProductName.Contains(ProductName.ToLower())).ToList());
     }
 }
Ejemplo n.º 15
0
 public List <View_SubZone> Select()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_SubZone.ToList());
     }
 }
Ejemplo n.º 16
0
 public List <tbl_employee> SearchByDesig()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_employee.Where(a => a.Designation == "Salesman").ToList());
     }
 }
Ejemplo n.º 17
0
 public List <View_SubZone> SearchByName()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_SubZone.Where(a => a.SubRouteName.Contains(SubRouteName.ToLower())).ToList());
     }
 }
Ejemplo n.º 18
0
 public List <tbl_Login_Type> SelectLogin()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_Login_Type.ToList());
     }
 }
Ejemplo n.º 19
0
 public List <tbl_Category> SearchByName()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_Category.Where(a => a.CategoryName.Contains(CategoryName.ToLower())).ToList());
     }
 }
Ejemplo n.º 20
0
 public tbl_employee ForLogin()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_employee.Where(a => a.Username == Username && a.Password == Password).SingleOrDefault());
     }
 }
Ejemplo n.º 21
0
 public List <View_ProductPrice> Search()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_ProductPrice.Where(a => a.ProductName.Contains(Productname.ToLower())).ToList());
     }
 }
Ejemplo n.º 22
0
 public List <tbl_Company> SearchByName()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_Company.Where(a => a.CompanyName == CompanyName).ToList());
     }
 }
Ejemplo n.º 23
0
 public List <tbl_Customer> SearchByName()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_Customer.Where(a => a.Name == Name).ToList());
     }
 }
Ejemplo n.º 24
0
 public List <tbl_Company> Select()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_Company.ToList());
     }
 }
Ejemplo n.º 25
0
 public List <View_tbl_Customer> SearchByCusName()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_tbl_Customer.Where(a => a.Name.Contains(Name.ToLower())).ToList());
     }
 }
Ejemplo n.º 26
0
 public List <View_DetailPurchase> search()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_DetailPurchase.Where(m => m.InvoiceNo == PInvoice).ToList());
     }
 }
Ejemplo n.º 27
0
 public List <tbl_CustomerTypes> Search()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_CustomerTypes.Where(a => a.CusTypeID == CusTypeID).ToList());
     }
 }
Ejemplo n.º 28
0
 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();
         }
     }
 }
Ejemplo n.º 29
0
 public List <tbl_CustomerTypes> SearchByName()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.tbl_CustomerTypes.Where(a => a.CusType.Contains(CusType.ToLower())).ToList());
     }
 }
Ejemplo n.º 30
0
 public List <View_tbl_Product> SearchByName()
 {
     using (var context = new CashCarryEntities3())
     {
         return(context.View_tbl_Product.Where(a => a.ProductName == ProductName).ToList());
     }
 }