Beispiel #1
0
        internal IEnumerable <RDepartmentType> GetDepartmentType(string OCODE)
        {
            using (var _context = new ERPSSL_INVEntities())
            {
                var ParamempID = new SqlParameter("@OCODE", OCODE);

                string SP_SQL = "Inv_GetDepartmentType @OCODE";

                return((_context.ExecuteStoreQuery <RDepartmentType>(SP_SQL, ParamempID)).ToList());
            }
        }
        public IEnumerable <StoreInCharge> GetStoreIncharge( )
        {
            using (var _context = new ERPSSL_INVEntities())
            {
                return((from emp in _context.HRM_PersonalInformations

                        select new StoreInCharge
                {
                    Eid = emp.EID,
                    Store_fullname = emp.FirstName + "-" + emp.LastName
                }).ToList());
            }
        }
Beispiel #3
0
 internal List <productsDetails> Rpt_GetAllProducts()
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             string SP_SQL = "INV_ProductReports_RPT ";
             return((_context.ExecuteStoreQuery <productsDetails>(SP_SQL)).ToList());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
 }
Beispiel #4
0
 public List <SuplierDetails> Rpt_GetAllSupplier()
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             string SP_SQL = "INV_SuplierReports_RPT ";
             return((_context.ExecuteStoreQuery <SuplierDetails>(SP_SQL)).ToList());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
 }
Beispiel #5
0
 public List <productsDetails> Rpt_GetStockBy_ReOrderQty()
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             string SP_SQL = "INV_FullStockReportsBy_ReOrderQty_RPT";
             return((_context.ExecuteStoreQuery <productsDetails>(SP_SQL)).ToList());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
 }
 internal List <GINStoreReqR> GetAll_DistinctApprovedStoreReq()
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             string SP_SQL = "PRQ_GetAll_DistinctApprovedStoreReq";
             return((_context.ExecuteStoreQuery <GINStoreReqR>(SP_SQL)).ToList());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
 }
 public static List <string> SearchSupplier(string prefixText, int count)
 {
     using (var _context = new ERPSSL_INVEntities())
     {
         var InsList = from la in _context.Inv_Supplier
                       where la.SupplierName.Contains(prefixText)
                       select la;
         List <String> clsList = new List <String>();
         foreach (var clsName in InsList)
         {
             clsList.Add(clsName.SupplierName);
         }
         return(clsList);
     }
 }
Beispiel #8
0
 public static List <string> SearchChallanNo(string prefixText, int count)
 {
     using (var _context = new ERPSSL_INVEntities())
     {
         var BuyCen = from By in _context.Inv_BuyCentral
                      where (By.RefNo_ChallanNo.Contains(prefixText))
                      select By;
         List <String> refList = new List <String>();
         foreach (var RefNos in BuyCen)
         {
             refList.Add(RefNos.RefNo_ChallanNo);
         }
         return(refList);
     }
 }
Beispiel #9
0
 public Inv_Buy GetBuyBarcodeAndComanyCode(string Barcode, string CompanyCode)
 {
     using (ERPSSL_INVEntities ctx = new ERPSSL_INVEntities())
     {
         try
         {
             Inv_Buy buy = ctx.Inv_Buy.Where(bc => bc.BarCode == Barcode && bc.CompanyCode == CompanyCode).FirstOrDefault <Inv_Buy>();
             return(buy);
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
 }
Beispiel #10
0
 internal List <ProductLog> Rpt_GetAllProduct(string OCODE)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    ocode  = new SqlParameter("@OCODE", OCODE);
             string SP_SQL = "INV_Product_Update_Log @OCODE";
             return((_context.ExecuteStoreQuery <ProductLog>(SP_SQL, ocode)).ToList());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #11
0
 public List <productsDetails> Rpt_GetStockBy_Store(string StoreCode)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    store  = new SqlParameter("@StoreCode", StoreCode);
             string SP_SQL = "INV_FullStockReportsBy_Store_RPT @StoreCode";
             return((_context.ExecuteStoreQuery <productsDetails>(SP_SQL, store)).ToList());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
 }
 internal List <PRQ_PurchaseOrders> GetAllPurchaseOrderByPONo(string PONo)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    PONO   = new SqlParameter("@PONo", PONo);
             string SP_SQL = "PRQ_GetWorkOrdersToRcvProduct_ByPONo @PONo";
             return((_context.ExecuteStoreQuery <PRQ_PurchaseOrders>(SP_SQL, PONO)).ToList());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
 internal List <PRQ_PurchaseOrders> GetAllPurchaseOrder(string PurchaseType)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    type   = new SqlParameter("@PurchaseType", PurchaseType);
             string SP_SQL = "PRQ_GetDistinctWorkOrdersToRcvProduct @PurchaseType";
             return((_context.ExecuteStoreQuery <PRQ_PurchaseOrders>(SP_SQL, type)).ToList());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #14
0
 internal List <Inv_BuyCentral> GetAllPiNoLC()
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var PiNo = (from LC in _context.Inv_BuyCentral
                         select LC).OrderBy(x => x.Id).DistinctBy(x => x.PI_No);
             return(PiNo.ToList());
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #15
0
        internal List <Inv_BuyCentral> GetAllMAsterLC()
        {
            try
            {
                using (var _context = new ERPSSL_INVEntities())
                {
                    var MasterLC = (from LC in _context.Inv_BuyCentral

                                    select LC).OrderBy(x => x.Id).DistinctBy(x => x.MasterLCNo);
                    return(MasterLC.ToList());
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
 internal List <DeleveryProductR> PRQ_GetSelectedProductToDeliverByReqNo(string reqno, string Ocode)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    ocode           = new SqlParameter("@OCODE", Ocode);
             var    ParamsalRequsNo = new SqlParameter("@Req", reqno);
             string SP_SQL          = "PRQ_GetSelectedProductToDeliverByReqNo @OCODE,@Req";
             return((_context.ExecuteStoreQuery <DeleveryProductR>(SP_SQL, ocode, ParamsalRequsNo)).ToList());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
 }
Beispiel #17
0
 internal List <productsDetails> GetAllProductByGroupId(int groupID, string OCODE)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    groupid = new SqlParameter("@GroupID", groupID);
             var    oCode   = new SqlParameter("@OCODE", OCODE);
             string SP_SQL  = "INV_RPT_ProductListByGroupID @GroupID,@OCODE";
             return((_context.ExecuteStoreQuery <productsDetails>(SP_SQL, groupid, oCode)).ToList());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
 }
Beispiel #18
0
 internal List <productsDetails> GetAllGroupProductByEID(string EID, string OCODE)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    eid    = new SqlParameter("@EID", EID);
             var    ocode  = new SqlParameter("@OCODE", OCODE);
             string SP_SQL = "Inv_GetAllUserwiseCategory_Product @EID,@OCODE";
             return((_context.ExecuteStoreQuery <productsDetails>(SP_SQL, eid, ocode)).ToList());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
        internal int AddTempToStoreReq(string ReqNo)
        {
            try
            {
                using (var _context = new ERPSSL_INVEntities())
                {
                    var    ParamempID2 = new SqlParameter("@ReqNo", ReqNo);
                    string SP_SQL      = "PRQ_AddStore_Requisition @ReqNo";
                    _context.ExecuteStoreCommand(SP_SQL, ParamempID2);

                    return(1);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #20
0
 public List <productsDetails> Rpt_GetFullStockDetailsByDate(string FromDate, string ToDate, string OCODE)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    DateForm = new SqlParameter("@FromDate", FromDate);
             var    DateTo   = new SqlParameter("@ToDate", ToDate);
             var    OCode    = new SqlParameter("@OCODE", OCODE);
             string SP_SQL   = "Inv_Rpt_StockDetails_ByDate @FromDate,@ToDate,@OCODE ";
             return((_context.ExecuteStoreQuery <productsDetails>(SP_SQL, DateForm, DateTo, OCode)).ToList());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
 }
Beispiel #21
0
 public List <productsDetails> Rpt_GetStockBy_Store_Product(string StoreCode, string productGroupId, string ProductId)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    store   = new SqlParameter("@StoreCode", StoreCode);
             var    group   = new SqlParameter("@ProductGroupId", productGroupId);
             var    product = new SqlParameter("@ProductId", ProductId);
             string SP_SQL  = "INV_FullStockReportsBy_Store_Product_RPT @StoreCode,@ProductGroupId,@ProductId";
             return((_context.ExecuteStoreQuery <productsDetails>(SP_SQL, store, group, product)).ToList());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
 }
Beispiel #22
0
 internal IEnumerable <RReturn> GetReturnFromSupplier_ByDate(string OCODE, DateTime Fromdate, DateTime Todate)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    ParamempID1 = new SqlParameter("@OCODE", OCODE);
             var    ParamempID2 = new SqlParameter("@FROMDATE", Fromdate);
             var    ParamempID3 = new SqlParameter("@TODATE", Todate);
             string SP_SQL      = "Inv_Rpt_ReturnFromSupplier_ByDate @OCODE,@FROMDATE,@TODATE";
             return((_context.ExecuteStoreQuery <RReturn>(SP_SQL, ParamempID1, ParamempID2, ParamempID3)).ToList());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
        internal int AddPurchaseRequisition_ForNewItem(string productName, string description)
        {
            try
            {
                using (var _context = new ERPSSL_INVEntities())
                {
                    var    ParamempID1 = new SqlParameter("@ProductName", productName);
                    var    ParamempID2 = new SqlParameter("@Description", description);
                    string SP_SQL      = "PRQ_AddPurchaseRequisition_ForNewItem @ProductName,@Description";
                    _context.ExecuteStoreCommand(SP_SQL, ParamempID1, ParamempID2);

                    return(1);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #24
0
        public int UpdateInv_RChallan_Temp(string ChallanNo, string barcode, double receiveQty)
        {
            try
            {
                using (var _context = new ERPSSL_INVEntities())
                {
                    var Parma1 = new SqlParameter("@ChallanNo", ChallanNo);
                    var Param2 = new SqlParameter("@BarCode", barcode);
                    var Param3 = new SqlParameter("@ReceiveQuantity", receiveQty);
                    //var Param5 = new SqlParameter("@ChalanTotal", total);

                    string SP_SQL = "Inv_RChallan_Temp_Update @ChallanNo,@BarCode";
                    _context.ExecuteStoreCommand(SP_SQL, Parma1, Param2, Param3);
                    return(1);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }
        }
Beispiel #25
0
        internal List <Inv_Return_Temp> GetTempReturn(string p, Guid userId)
        {
            List <Inv_Return_Temp> list = new List <Inv_Return_Temp>();

            using (ERPSSL_INVEntities ctx = new ERPSSL_INVEntities())
            {
                try
                {
                    // ctx.Configuration.ProxyCreationEnabled = false;
                    list = (from c in ctx.Inv_Return_Temp
                            //join r in ctx.Inv_ProductGroup on c.ProductGroup equals r.GroupId
                            where c.OCode == p && c.EditUser == userId
                            select c).ToList();
                    return(list);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
Beispiel #26
0
        internal List <Inv_Damage_Temp> GetTempDanmage(string p, string challanNo)
        {
            List <Inv_Damage_Temp> list = new List <Inv_Damage_Temp>();

            using (ERPSSL_INVEntities ctx = new ERPSSL_INVEntities())
            {
                try
                {
                    // ctx.Configuration.ProxyCreationEnabled = false;
                    list = (from c in ctx.Inv_Damage_Temp
                            //join r in ctx.Inv_ProductGroup on c.ProductGroup equals r.GroupId
                            where c.OCode == p && c.ChallanNo == challanNo
                            select c).ToList();
                    return(list);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
Beispiel #27
0
 public List <productsDetails> Rpt_GetFullStockDetailsByDate_Product_WithStore(string FromDate, string ToDate, string OCODE, string GroupId, string ProductId, string storeCode)
 {
     try
     {
         using (var _context = new ERPSSL_INVEntities())
         {
             var    DateForm  = new SqlParameter("@FromDate", FromDate);
             var    DateTo    = new SqlParameter("@ToDate", ToDate);
             var    OCode     = new SqlParameter("@OCODE", OCODE);
             var    groupId   = new SqlParameter("@GroupId", GroupId);
             var    productId = new SqlParameter("@ProductId", ProductId);
             var    Store     = new SqlParameter("@StoreCode", storeCode);
             string SP_SQL    = "Inv_Rpt_StockDetails_ByDate_Product_WithStore @FromDate,@ToDate,@OCODE,@GroupId,@ProductId,@StoreCode ";
             return((_context.ExecuteStoreQuery <productsDetails>(SP_SQL, DateForm, DateTo, OCode, groupId, productId, Store)).ToList());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
 }
Beispiel #28
0
        public int Update_IChalanTemp(Guid UserId, string barcode, double delivaryQty)
        {
            try
            {
                using (var _context = new ERPSSL_INVEntities())
                {
                    var    Parma1 = new SqlParameter("@UserId", UserId);
                    var    Param2 = new SqlParameter("@BarCode", barcode);
                    var    Param3 = new SqlParameter("@DeliveryQty", delivaryQty);
                    string SP_SQL = "Inv_IChallan_Temp_Update @UserId,@BarCode,@DeliveryQty";


                    _context.ExecuteStoreCommand(SP_SQL, Parma1, Param2, Param3);

                    return(1);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }
        }
Beispiel #29
0
        public int UpdateInv_RChallanmrr_Temp(string ChallanNo, string barcode, double receiveQty, double ActualQty, double freeQty, DateTime PDate)
        {
            try
            {
                using (var _context = new ERPSSL_INVEntities())
                {
                    var Parma1  = new SqlParameter("@ChallanNo", ChallanNo);
                    var Param2  = new SqlParameter("@BarCode", barcode);
                    var Param3  = new SqlParameter("@ReceiveQuantity", receiveQty);
                    var PurDate = new SqlParameter("@PurchaseDate", PDate);
                    var Param4  = new SqlParameter("@ActualQty", ActualQty);
                    var Param5  = new SqlParameter("@FreeQty", freeQty);

                    string SP_SQL = "Inv_RChallan_Tempmrr_Update @ChallanNo,@BarCode,@ReceiveQuantity,@ActualQty,@FreeQty,@PurchaseDate";
                    _context.ExecuteStoreCommand(SP_SQL, Parma1, Param2, Param3, Param4, Param5, PurDate);
                    return(1);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }
        }