コード例 #1
0
        public static bool UpdateIsMinimumUnitFalse(ProductUnitPrice objProductUnitPrice)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 2);
                param[0] = dbManager.getparam("@ProductID", objProductUnitPrice.ProductID);
                param[1] = dbManager.getparam("@UpdatedBy", objProductUnitPrice.UpdatedBy);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_updateIsMinimumUnitFalse", param);
                chk = dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return(false);
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
コード例 #2
0
        public static DataTable LoadPurchaseInvoice(string FromDate, string ToDate)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 2);

                param[0] = dbManager.getparam("@FromDate", FromDate);
                param[1] = dbManager.getparam("@ToDate", ToDate);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_ListOfPurchaseInvice]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #3
0
        public static bool InsertSalesPayment(SalesPaymentInfo objSalesPaymentInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            bool isSave = true;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 5);
                param[0] = dbManager.getparam("@InvoiceNo", objSalesPaymentInfo.InvoiceNo);
                param[1] = dbManager.getparam("@PaidAmount", Convert.ToDouble(objSalesPaymentInfo.PaidAmount));
                param[2] = dbManager.getparam("@TerminalID", objSalesPaymentInfo.TerminalID);
                param[3] = dbManager.getparam("@CreatedBy", Convert.ToInt64(objSalesPaymentInfo.CreatedBy));
                param[4] = dbManager.getparam("@CustomerCode", objSalesPaymentInfo.CustomerID);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_SalesPaymentInfo_Add]", param);
                dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                isSave = false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(isSave);
        }
コード例 #4
0
        public static bool InsertPurchasePayment(PurchasePaymentInfo objPurchasePaymentInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            bool isSave = true;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 5);

                param[0] = dbManager.getparam("@PurchaseID", objPurchasePaymentInfo.PurchaseID);
                param[1] = dbManager.getparam("@PaidAmount", Convert.ToDouble(objPurchasePaymentInfo.PaidAmount));
                param[2] = dbManager.getparam("@SupplierID", objPurchasePaymentInfo.SupplierID);
                param[3] = dbManager.getparam("@TerminalID", objPurchasePaymentInfo.TerminalID);
                param[4] = dbManager.getparam("@CreatedBy", Convert.ToInt64(objPurchasePaymentInfo.CreatedBy));

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_PurchasePaymentInfo_Add]", param);
                dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                isSave = false;
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(isSave);
        }
コード例 #5
0
        public static DataTable InsertPurchaseMaster_For_SalesReturn(ProductPurchaseInfo objProductPurchaseInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 10);

                param[0] = dbManager.getparam("@PurchaseDate", objProductPurchaseInfo.PurchaseDate);
                param[1] = dbManager.getparam("@MemoNo", objProductPurchaseInfo.MemoNo);
                param[2] = dbManager.getparam("@TotalAmount", objProductPurchaseInfo.TotalAmount);
                param[3] = dbManager.getparam("@TotalPaid", objProductPurchaseInfo.TotalPaid);
                param[4] = dbManager.getparam("@SupplierAccountNo", objProductPurchaseInfo.SupplierAccountNo);
                param[5] = dbManager.getparam("@CreatedBy", objProductPurchaseInfo.CreatedBy);
                param[6] = dbManager.getparam("@pk_code", "");
                param[7] = dbManager.getparam("@TerminalID", bllUtility.LoggedInSystemInformation.TerminalID.ToString());
                param[8] = dbManager.getparam("@TransactionType", objProductPurchaseInfo.TransactionType);
                param[9] = dbManager.getparam("@PurchaseID", objProductPurchaseInfo.PurchaseID);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_PurchaseMasterInfo_Add_From_Sales", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                //return false;
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #6
0
        public static string Insert(string MaterialID, string MaterialName, string UnitID, string ActivityID)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            string             id        = "";

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 5);

                param[0] = dbManager.getparam("@MaterialID", MaterialID);
                param[1] = dbManager.getparam("@MaterialName", MaterialName);
                param[2] = dbManager.getparam("@UnitID", Convert.ToInt16(UnitID));
                param[3] = dbManager.getparam("@ActivityID", ActivityID);
                param[4] = dbManager.getparam("@UserID", bllUtility.LoggedInSystemInformation.LoggedUserId);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[USP_Material_InsertUpdate]", param);

                id = Convert.ToString(dbManager.ExecuteScalar(cmd));
            }
            catch (Exception ex)
            {
                return("Err:" + ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(id);
        }
コード例 #7
0
        public static DataTable getById(long AccountHolderTypeID)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 1);

                param[0] = dbManager.getparam("@AccountHolderTypeID", AccountHolderTypeID);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_accountholdertype_getbyId", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #8
0
        public static DataTable Receive_Payment(WarrentyService obj)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 6);
                param[0] = dbManager.getparam("@ServiceNumber", obj.ServiceNumber);
                param[1] = dbManager.getparam("@PaidAmount", obj.PaidAmount);
                param[2] = dbManager.getparam("@Status", obj.Status);
                param[3] = dbManager.getparam("@CustomerID", obj.CustomerID);
                param[4] = dbManager.getparam("@TerminalID", bllUtility.LoggedInSystemInformation.TerminalID);
                param[5] = dbManager.getparam("@CreatedBy", bllUtility.LoggedInSystemInformation.LoggedUserId);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[update_service_payment]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #9
0
        public static bool Insert(ManufacturerInfo objManufacturerInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 5);

                param[0] = dbManager.getparam("@ManufacturarName", objManufacturerInfo.ManufacturarName.ToString());
                param[1] = dbManager.getparam("@ActivityID", objManufacturerInfo.ActivityID.ToString());

                param[2] = dbManager.getparam("@CreatedDate", objManufacturerInfo.CreatedDate);
                param[3] = dbManager.getparam("@CreatedBy", objManufacturerInfo.CreatedBy.ToString());
                param[4] = dbManager.getparam("@IsDeleted", false);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_ManufacturerInfo_Add", param);

                chk = dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return(false);
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
コード例 #10
0
        public static DataTable InsertData(AccountTransaction objAccountTransaction)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 8);
                param[0] = dbManager.getparam("@TransactionDate", objAccountTransaction.TransactionDate);
                param[1] = dbManager.getparam("@TerminalID", Convert.ToInt64(objAccountTransaction.TerminalID));
                param[2] = dbManager.getparam("@AccountNo", objAccountTransaction.AccountHolderID.ToUpper());
                param[3] = dbManager.getparam("@ATTID", Convert.ToInt64(objAccountTransaction.ATTID));
                param[4] = dbManager.getparam("@Description", objAccountTransaction.Description);
                param[5] = dbManager.getparam("@Debit", Convert.ToDecimal(objAccountTransaction.Debit));
                param[6] = dbManager.getparam("@Credit", Convert.ToDecimal(objAccountTransaction.Credit));
                param[7] = dbManager.getparam("@CreatedBy", Convert.ToInt64(objAccountTransaction.CreatedBy));

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_AccountTransactionDetailsInfo_Add]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                //return false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #11
0
        public static DataTable IsDuplicateProductCode(string SerialNo, string ProductID, string EventType)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 3);
                param[0] = dbManager.getparam("@SerialNo", SerialNo);
                param[1] = dbManager.getparam("@ProductID", ProductID);
                param[2] = dbManager.getparam("@EventType", EventType);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_IsDuplicateProductCode", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #12
0
        public static bool UpdateData(AccountTransaction objAccountTransaction)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 9);
                param[0] = dbManager.getparam("@ATID", Convert.ToInt64(objAccountTransaction.ATID));
                param[1] = dbManager.getparam("@TransactionDate", objAccountTransaction.TransactionDate.ToString());
                param[2] = dbManager.getparam("@TerminalID", Convert.ToInt64(objAccountTransaction.TerminalID));
                param[3] = dbManager.getparam("@AccountNo", objAccountTransaction.AccountHolderID.ToUpper());
                param[4] = dbManager.getparam("@ATTID", Convert.ToInt64(objAccountTransaction.ATTID));
                param[5] = dbManager.getparam("@Description", objAccountTransaction.Description);
                param[6] = dbManager.getparam("@Debit", Convert.ToDecimal(objAccountTransaction.Debit));
                param[7] = dbManager.getparam("@Credit", Convert.ToDecimal(objAccountTransaction.Credit));
                param[8] = dbManager.getparam("@UpdatedBy", Convert.ToInt64(objAccountTransaction.CreatedBy));

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_AccountTransactionDetailsInfo_Update]", param);

                chk = dbManager.ExecuteQuery(cmd);
                //dbManager.ExecuteReader(cmd);
            }
            catch (Exception ex)
            {
                return(false);
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
コード例 #13
0
        public static DataTable GetAccTransDetails(AccountTransaction objAccountTransaction)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 5);
                param[0] = dbManager.getparam("@ATTID", objAccountTransaction.SearchATTID);
                param[1] = dbManager.getparam("@AccountNo", objAccountTransaction.SearchAccountNo);
                param[2] = dbManager.getparam("@DateFrom", objAccountTransaction.SearchDateFrom);
                param[3] = dbManager.getparam("@DateTo", objAccountTransaction.SearchDateTo);
                param[4] = dbManager.getparam("@IsEditable", objAccountTransaction.SearchIsEditable);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_GetAccTransDetails]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                //return false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #14
0
        public static DataTable Insert(int OfferID, string StartDate, string EndDate, string ProductID, int Qty, string FreeProductID, int FreeQty, string GiftName, int GiftQty, string GiftUnitID)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 10);

                param[0] = dbManager.getparam("@OfferID", OfferID);
                param[1] = dbManager.getparam("@StartDate", StartDate);
                param[2] = dbManager.getparam("@EndDate", EndDate);
                param[3] = dbManager.getparam("@ProductID", ProductID);
                param[4] = dbManager.getparam("@Qty", Qty);
                param[5] = dbManager.getparam("@FreeProductID", FreeProductID);
                param[6] = dbManager.getparam("@FreeQty", FreeQty);
                param[7] = dbManager.getparam("@GiftName", GiftName);
                param[8] = dbManager.getparam("@GiftQty", GiftQty);
                param[9] = dbManager.getparam("@GiftUnitID", GiftUnitID);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_ProductOffer_InsertUpdate", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                //return false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #15
0
        public static bool Delete(long SectionId)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 1);
                param[0] = dbManager.getparam("@SectionId", SectionId);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_sectioninfo_delete", param);

                chk = dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                return(false);

                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
コード例 #16
0
        public static bool Insert(AccountTransactions objTransaction)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 9);
                param[0] = dbManager.getparam("@account_number", objTransaction.AccountHolderCode);
                param[1] = dbManager.getparam("@account_head_id", objTransaction.AccountHead);
                param[2] = dbManager.getparam("@bill_type", "");
                param[3] = dbManager.getparam("@bill_amount", objTransaction.BillAmount);
                param[4] = dbManager.getparam("@paid_amount", objTransaction.PaidAmount);
                param[5] = dbManager.getparam("@ref_number", objTransaction.RefNumber);
                param[6] = dbManager.getparam("@remarks", objTransaction.Remarks);
                param[7] = dbManager.getparam("@transactionDate", "");
                param[8] = dbManager.getparam("@creator", "");

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_accountTransactions_Add", param);

                chk = dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                return(false);
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
コード例 #17
0
        public static bool Insert(SectionInfo objSectionInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 6);

                param[0] = dbManager.getparam("@SectionName", objSectionInfo.SectionName.ToString());
                param[1] = dbManager.getparam("@ActivityID", objSectionInfo.ActivityID.ToString());

                param[2] = dbManager.getparam("@CreatedDate", objSectionInfo.CreatedDate);
                param[3] = dbManager.getparam("@CreatedBy", objSectionInfo.CreatedBy.ToString());
                param[4] = dbManager.getparam("@IsDeleted", false);
                param[5] = dbManager.getparam("@DiscountPercent", objSectionInfo.DiscountPercent);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_SectionInfo_Add", param);

                chk = dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                return(false);
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
コード例 #18
0
        public static DataTable get_account_wise_due_amount(string account_number)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 1);

                param[0] = dbManager.getparam("@account_number", account_number);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_accountTransactions_account_wise_due_populate", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #19
0
        public static DataTable IsDuplicate_AccountHolder_Type(long AccountHolderTypeID, string AccountHolderType, string EventType)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 3);
                param[0] = dbManager.getparam("@AccountHolderTypeID", AccountHolderTypeID);
                param[1] = dbManager.getparam("@AccountHolderType", AccountHolderType);
                param[2] = dbManager.getparam("@EventType", EventType);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.[USP_IsDuplicate_AccountHolder_Type]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #20
0
        public static DataTable get_account_trans_details(string from_date, string to_date)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 2);

                param[0] = dbManager.getparam("@fromDate", from_date);
                param[1] = dbManager.getparam("@toDate", to_date);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_accountTransactions_populate", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #21
0
        public static bool Insert(AccountHolderType objAccountHolderType)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 5);

                //param[0] = dbManager.getparam("@UnitId", objUnitInfo.UnitId.ToString());
                param[0] = dbManager.getparam("@AccountHolderType", objAccountHolderType.AccountHolderTypeName.ToString());
                param[1] = dbManager.getparam("@ActivityID", objAccountHolderType.ActivityID.ToString());
                param[2] = dbManager.getparam("@CreatedDate", objAccountHolderType.CreatedDate);
                param[3] = dbManager.getparam("@CreatedBy", objAccountHolderType.CreatedBy.ToString());
                param[4] = dbManager.getparam("@AccountHolderTypePrefix", objAccountHolderType.AccountHolderTypePrefix.ToString());



                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_AccountHolderType_Add", param);

                chk = dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                return(false);
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
コード例 #22
0
        public static DataTable InsertUpdate(DepartmentInfo objDepartmentInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 4);
                param[0] = dbManager.getparam("@DepartmentID", objDepartmentInfo.DepartmentID.ToString());
                param[1] = dbManager.getparam("@DepartmentName", objDepartmentInfo.DepartmentName.ToString());
                param[2] = dbManager.getparam("@ActivityID", objDepartmentInfo.ActivityID.ToString());
                param[3] = dbManager.getparam("@CreatedBy", objDepartmentInfo.CreatedBy.ToString());

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_DepartmentInfo_InsertUpdate", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #23
0
        public static DataTable LoadPurchase_For_Delete(string purchaseID)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 1);
                param[0] = dbManager.getparam("@PurchaseID", purchaseID);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.LoadPurchaseInformation_Delete", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                //return false;
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #24
0
        public static bool InsertRequisition(string RequisitionID, string DealerID, string RequisitionDate, string PaymentMode, string PaymentAmount, string ProductID, string Quantity)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            bool isSave = true;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 8);

                param[0] = dbManager.getparam("@RequisitionID", RequisitionID);
                param[1] = dbManager.getparam("@DealerID", DealerID);
                param[2] = dbManager.getparam("@RequisitionDate", Convert.ToDateTime(RequisitionDate).ToString("dd/MM/yyyy"));
                param[3] = dbManager.getparam("@PaymentMode", PaymentMode);
                param[4] = dbManager.getparam("@PaymentAmount", PaymentAmount);
                param[5] = dbManager.getparam("@ProductID", ProductID);
                param[6] = dbManager.getparam("@Quantity", Quantity);
                param[7] = dbManager.getparam("@UserID", bllUtility.LoggedInSystemInformation.LoggedUserId.ToString());
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[insert_requisition_details]", param);
                dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                isSave = false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(isSave);
        }
コード例 #25
0
        public static DataTable LoadSalesInvoice(string SalesDateFrom, string SalesDateTo, string TerminalID, string customer_id)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 4);

                param[0] = dbManager.getparam("@SalesDateFrom", SalesDateFrom);
                param[1] = dbManager.getparam("@SalesDateTo", SalesDateTo);
                param[2] = dbManager.getparam("@TerminalId", TerminalID);
                param[3] = dbManager.getparam("@AccountNo", customer_id);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_ListOfSalesInvice]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #26
0
        public static bool InsertClosing(string ClosingStockID, string DealerID, string Year, string Month, string ProductID, string Quantity)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            bool isSave = true;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 7);
                param[0] = dbManager.getparam("@DealerID", DealerID);
                param[1] = dbManager.getparam("@Year", Year);
                param[2] = dbManager.getparam("@Month", Month);
                param[3] = dbManager.getparam("@ProductID", ProductID);
                param[4] = dbManager.getparam("@Quantity", Convert.ToInt16(Quantity));
                param[5] = dbManager.getparam("@ReceivedBy", bllUtility.LoggedInSystemInformation.LoggedUserId.ToString());
                param[6] = dbManager.getparam("@ClosingStockID", ClosingStockID);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[import_closing_stock]", param);
                dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                isSave = false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(isSave);
        }
コード例 #27
0
        public static DataTable InsertSalesParent(SaleMaster objSaleMaster)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 12);
                param[0]  = dbManager.getparam("@SalesType", objSaleMaster.SalesType);
                param[1]  = dbManager.getparam("@CustomerCode", objSaleMaster.CustomerID);
                param[2]  = dbManager.getparam("@SalesmanID", objSaleMaster.SalemanID);
                param[3]  = dbManager.getparam("@SalesAmount", Convert.ToDouble(objSaleMaster.SalesAmount));
                param[4]  = dbManager.getparam("@TerminalID", Convert.ToInt32(objSaleMaster.TerminalID));
                param[5]  = dbManager.getparam("@CreatedBy", Convert.ToInt32(objSaleMaster.CreatedBy));
                param[6]  = dbManager.getparam("@CashPaid", Convert.ToDouble(objSaleMaster.CashPaid));
                param[7]  = dbManager.getparam("@CustomerName", objSaleMaster.CustomerName);
                param[8]  = dbManager.getparam("@CustomerAddress", objSaleMaster.CustomerAddress);
                param[9]  = dbManager.getparam("@CustomerPhone", objSaleMaster.CustomerPhone);
                param[10] = dbManager.getparam("@VehicleNo", objSaleMaster.VehicleNo);
                param[11] = dbManager.getparam("@PO_Number", objSaleMaster.PO_Number);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[insert_sales_master]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                //return false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #28
0
        public static DataTable LoadSalesInvoice(string _FromDate, string _ToDate)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 2);

                param[0] = dbManager.getparam("@DateFrom", _FromDate);
                param[1] = dbManager.getparam("@DateTo", _ToDate);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[list_of_sales_no]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
コード例 #29
0
        public static bool InsertSalesDetails(SalesChild objSalesChild)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            bool isSave = true;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 8);

                param[0] = dbManager.getparam("@SalesMasterID", Convert.ToInt32(objSalesChild.SalesMasterID));
                param[1] = dbManager.getparam("@ProductSizeID", Convert.ToInt32(objSalesChild.ProductSizeID));
                param[2] = dbManager.getparam("@Manufacturer", objSalesChild.Manufacturer);
                param[3] = dbManager.getparam("@SalesQuantity", Convert.ToInt32(objSalesChild.SalesQuantity));
                param[4] = dbManager.getparam("@UnitSalesPrice", Convert.ToDouble(objSalesChild.UnitSalesPrice));
                param[5] = dbManager.getparam("@VatRate", Convert.ToDouble(objSalesChild.VatRate));
                param[6] = dbManager.getparam("@WarrentyID", Convert.ToInt32(objSalesChild.WarrentyID));
                param[7] = dbManager.getparam("@SerialNo", objSalesChild.SerialNo);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[insert_sales_child]", param);
                dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                isSave = false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(isSave);
        }
コード例 #30
0
        public static bool InsertPurchaseMasterDetails(string purchaseID, string MaterialID, string purchaseQty, string purchasePrice, string createdBy)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 5);

                param[0] = dbManager.getparam("@PurchaseID", purchaseID);
                param[1] = dbManager.getparam("@MaterialID", MaterialID);
                param[2] = dbManager.getparam("@PurchaseQty", Convert.ToDouble(purchaseQty));
                param[3] = dbManager.getparam("@PurchasePrice", Convert.ToDouble(purchasePrice));
                param[4] = dbManager.getparam("@CreatedBy", Convert.ToInt32(createdBy));
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_MaterialLotDetailsEntry", param);
                dbManager.ExecuteQuery(cmd);
                chk = true;
            }
            catch (Exception ex)
            {
                return(false);

                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }