Esempio n. 1
0
        public static DataTable load_issue_child(string _IssueID)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

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

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "load_issue_details_by_issue_no", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 4
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);
        }
Esempio n. 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);
        }
Esempio n. 6
0
        public static DataTable getAll()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.Text, @"select 
                ai.ActivityID,
                ai.Activity,
                si.SectionId,
                si.SectionName,
                si.ActivityID,
                si.UpdatedDate,
                si.UpdatedBy,
                si.DiscountPercent 
                from dbo.SectionInfo si left outer join dbo.ActivityInfo ai
                on ai.ActivityID = si.ActivityID Where si.IsDeleted=0 order by si.SectionName", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Esempio n. 7
0
        public static DataTable getAll()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;


                IDbCommand cmd = dbManager.getCommand(CommandType.Text, @"select 
* 
from dbo.AccountHolderType aht left outer join dbo.ActivityInfo ai
on ai.ActivityID = aht.ActivityID", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Esempio n. 8
0
        public static DataTable GetMinimumUnitByName(string ProductName)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.Text, @"SELECT dbo.ProductSalesPrice.ProductID, dbo.UnitInfo.UnitName, dbo.ProductInfo.ProductName
                    FROM  dbo.ProductSalesPrice 
                    INNER JOIN   dbo.UnitInfo ON dbo.ProductSalesPrice.UnitID = dbo.UnitInfo.UnitId 
                    INNER JOIN   dbo.ProductInfo ON dbo.ProductSalesPrice.ProductID = dbo.ProductInfo.ProductID
                    WHERE (dbo.ProductSalesPrice.IsMinimumUnit = 1) AND (dbo.ProductSalesPrice.ProductName = '" + ProductName + "')", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
        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);
        }
Esempio n. 10
0
        public static DataTable getAll()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;


                IDbCommand cmd = dbManager.getCommand(CommandType.Text, @"select 
                ai.ActivityID,
                ai.Activity,
                ui.UnitId,
                ui.UnitName,
                ui.ActivityID,
                ui.UpdatedDate,
                ui.UpdatedBy 
                from dbo.UnitInfo ui left outer join dbo.ActivityInfo ai
                on ai.ActivityID = ui.ActivityID Where ui.IsDeleted=0", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Esempio n. 11
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);
        }
        public static DataTable InsertSalesReturnParent(SalesReturnParent objSalesReturnParent, string AccountNo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

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

                param[0] = dbManager.getparam("@SalesNo", objSalesReturnParent.InvoiceNo);
                param[1] = dbManager.getparam("@TotalAmount", Convert.ToDouble(objSalesReturnParent.TotalAmount));
                param[2] = dbManager.getparam("@CreatedBy", Convert.ToInt64(objSalesReturnParent.CreatedBy));
                param[3] = dbManager.getparam("@TerminalID", objSalesReturnParent.TerminalID);
                param[4] = dbManager.getparam("@pk_code", "");
                param[5] = dbManager.getparam("@AccountNo", AccountNo);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_SalesReturnParent_Add]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                //return false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
        public static DataTable GetAccountHolderInfo(string AccountNo, string AccountHolderTypeID)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 2);
                param[0] = dbManager.getparam("@AccountNo", AccountNo);
                param[1] = dbManager.getparam("@AccountHolderTypeID", AccountHolderTypeID);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[USP_GetAccountHolderInfoByAccountNo]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Esempio n. 14
0
        public static DataTable getAll()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.Text, @"
                            SELECT SubSectionInfo.SubSectionID, SubSectionInfo.SubSectionName, SectionInfo.SectionName, ActivityInfo.Activity
                            FROM SubSectionInfo INNER JOIN
                            SectionInfo ON SubSectionInfo.SectionID = SectionInfo.SectionID INNER JOIN
                            ActivityInfo ON SubSectionInfo.ActivityID = ActivityInfo.ActivityID
                            WHERE (SubSectionInfo.IsDeleted = 0)
                            ORDER BY SectionInfo.SectionName", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Esempio n. 15
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);
        }
        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);
        }
Esempio n. 17
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);
        }
Esempio n. 18
0
        public static string getProductID(string ProductName)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();
            string             ProductID = "";

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.Text, @"Select ProductID From ProductInfo Where ProductName='" + ProductName + "'", param);
                dt = dbManager.GetDataTable(cmd);
                if (dt.Rows.Count > 0)
                {
                    ProductID = dt.Rows[0][0].ToString();
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(ProductID);
        }
Esempio n. 19
0
        public static DataTable getAll()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;


                IDbCommand cmd = dbManager.getCommand(CommandType.Text, @"select 
                PayTypeId,PayTypeName from PayTypeInfo order by PayTypeId", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Esempio n. 20
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);
        }
Esempio n. 21
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);
        }
Esempio n. 22
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);
        }
Esempio n. 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);
        }
Esempio n. 24
0
        public static DataTable getAll()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;


                IDbCommand cmd = dbManager.getCommand(CommandType.Text, @"SELECT *
from dbo.BranchInfo bi left outer join dbo.ActivityInfo ai
on ai.ActivityID = bi.ActivityID --Where bi.IsDeleted=0", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Esempio n. 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);
        }
        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);
        }
Esempio n. 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);
        }
        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);
        }
Esempio n. 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);
        }
Esempio n. 30
0
        public static DataTable insert_issue_master(DateTime _IssueDate, string _IssueTo, string _ProjectID, DateTime _ReturnDate)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 5);
                param[0] = dbManager.getparam("@IssueDate", _IssueDate);
                param[1] = dbManager.getparam("@IssueTo", _IssueTo);
                param[2] = dbManager.getparam("@ProjectID", Convert.ToInt32(_ProjectID));
                param[3] = dbManager.getparam("@ReturnDate", _ReturnDate);
                param[4] = dbManager.getparam("@CreatedBy", bllUtility.LoggedInSystemInformation.LoggedUserId.ToString());

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "insert_issue_master", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }