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;
            }
        }
        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;
            }
        }
        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());
            }
        }
        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());
            }
        }
        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());
            }
        }
        internal int Enter_VoucherDetails(string OCODE, string Company_Code, string Edit_User, string ModuleName, string ModuleType, string VoucherType, string IdentitiNo, Inv_RChallan rChallan_Obj)
        {
            try
            {
                decimal Amount = 0;
                Amount = Convert.ToDecimal(Amount) + (Convert.ToDecimal(rChallan_Obj.CPU) * Convert.ToDecimal(rChallan_Obj.ReceiveQuantity));

                var Amount_       = new SqlParameter("@Amount", Amount);
                var ModuleName_   = new SqlParameter("@ModuleName", ModuleName);
                var VoucherType_  = new SqlParameter("@VoucherType", VoucherType);
                var Edit_User_    = new SqlParameter("@Edit_User", Edit_User);
                var Company_Code_ = new SqlParameter("@Company_Code", Company_Code);
                var OCode_        = new SqlParameter("@OCode", OCODE);
                var ItemCode_     = new SqlParameter("@ItemCode", ModuleType);
                var Identity      = new SqlParameter("@IdentificationNo", IdentitiNo);

                string SP_SQL = "Vch_Enter_AC_VoucherDetails_by_Module  @Amount,@ModuleName,@VoucherType,@Edit_User,@Company_Code,@OCode,@ItemCode,@IdentificationNo";
                return(_context.ExecuteStoreCommand(SP_SQL, Amount_, ModuleName_, VoucherType_, Edit_User_, Company_Code_, OCode_, ItemCode_, Identity));
            }
            catch (Exception)
            {
                throw;
            }
        }