Beispiel #1
0
        public static bool InsertPurchaseReturnChild(Int32 _PRID, string _ProductID, Int32 _UnitID, decimal _Quantity, decimal _ReturnUnitPrice, decimal _ReturnTotalPrice)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            bool isSave = true;

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

                param[0] = dbManager.getparam("@PRID", _PRID);
                param[1] = dbManager.getparam("@ProductID", _ProductID);
                param[2] = dbManager.getparam("@UnitID", _UnitID);
                param[3] = dbManager.getparam("@Quantity", _Quantity);
                param[4] = dbManager.getparam("@ReturnUnitPrice", _ReturnUnitPrice);
                param[5] = dbManager.getparam("@TotalReturnPrice", _ReturnTotalPrice);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[USP_PurchaseReturnChild_Add]", param);
                dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                isSave = false;
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(isSave);
        }
Beispiel #2
0
        public static DataTable GetItemList(string ProductSizeID)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

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

                param[0] = dbManager.getparam("@ProductSizeID", Convert.ToInt32(ProductSizeID));

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "load_manufacturer_by_product_variation", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #3
0
        public static DataTable InsertPurchaseReturnParent(string _PRDate, string _SupplierID, double _TotalPRAmount)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

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

                param[0] = dbManager.getparam("@PRDate", _PRDate);
                param[1] = dbManager.getparam("@SupplierID", _SupplierID);
                param[2] = dbManager.getparam("@CreatedBy", bllUtility.LoggedInSystemInformation.LoggedUserId);
                param[3] = dbManager.getparam("@TerminalID", bllUtility.LoggedInSystemInformation.TerminalID);
                param[4] = dbManager.getparam("@TotalPRAmount", _TotalPRAmount);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_PurchaseReturnParent_Add]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                //return false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #4
0
        public static bool SoftDefaultSetting()
        {
            bool               IsValid   = false;
            DataTable          dt        = new DataTable();
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();

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

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_SofDefaultSettings]", param);
                dt = dbManager.GetDataTable(cmd);
                if (dt.Rows.Count > 0)
                {
                    IsValid = true;
                    bllUtility.DefaultSettings.ID = dt.Rows[0]["ID"].ToString();
                    bllUtility.DefaultSettings.DefaultSaleType     = dt.Rows[0]["DefaultSaleType"].ToString();
                    bllUtility.DefaultSettings.IsEditableSalePrice = dt.Rows[0]["SalesPriceIsEditable"].ToString();
                    bllUtility.DefaultSettings.DiscountAllow       = dt.Rows[0]["DiscountAllow"].ToString();
                    bllUtility.DefaultSettings.MiniAccAllow        = dt.Rows[0]["MiniAccAllow"].ToString();
                    bllUtility.DefaultSettings.CreditSaleAllow     = dt.Rows[0]["CreditSalesAllow"].ToString();
                    bllUtility.DefaultSettings.SalePrintType       = dt.Rows[0]["SalesInvoicePrintType"].ToString();
                    bllUtility.DefaultSettings.ExpireDateAllow     = dt.Rows[0]["ExpireDateAllow"].ToString();
                    bllUtility.DefaultSettings.Store2Display       = dt.Rows[0]["Store2Display"].ToString();

                    bllUtility.DefaultSettings.Ftp_url  = dt.Rows[0]["ftp_url"].ToString();
                    bllUtility.DefaultSettings.Ftp_user = dt.Rows[0]["ftp_user"].ToString();
                    bllUtility.DefaultSettings.Api_link = dt.Rows[0]["api_link"].ToString();

                    string p = dt.Rows[0]["ftp_pass"].ToString();
                    bllUtility.DefaultSettings.Ftp_pass       = p.Substring(3, p.Length - 5);
                    bllUtility.DefaultSettings.Csv_path_local = dt.Rows[0]["csv_path_local"].ToString();
                    bllUtility.DefaultSettings.No_of_days_syn = dt.Rows[0]["no_of_days_syn"].ToString();
                }
                else
                {
                    IsValid = false;
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(IsValid);
        }
        public static DataTable getAllCustomerOrSupplier(Int64 TypeCustOrSupp)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

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

                string     sql = @"SELECT *
                                from dbo.AccountHolderInfo ahi left outer join dbo.ActivityInfo ai
                                on ai.ActivityID = ahi.ActivityID
                                left outer join dbo.AccountHolderType aht on ahi.AccountHolderTypeID  = aht.AccountHolderTypeID 
                                Where ahi.IsDeleted=0 AND aht.AccountHolderTypeID = " + TypeCustOrSupp + "";
                IDbCommand cmd = dbManager.getCommand(CommandType.Text, sql, param);
                dt = dbManager.GetDataTable(cmd);
                dt.Columns.Add("ActivityName");
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        try
                        {
                            if (dr["ActivityID"].ToString().Equals("1"))
                            {
                                dr["ActivityName"] = "Active";
                            }
                            else
                            {
                                dr["ActivityName"] = "Inactive";
                            }
                        }
                        catch { }
                    }
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #6
0
        public static DataTable getAll(int isFixedAsset)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();
            string             sql;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                if (isFixedAsset == 2)
                {
                    sql = @"SELECT     dbo.ProductSizeLookup.ID, dbo.ProductInfo.PID, dbo.ProductInfo.ProductName, dbo.ManufacturerInfo.ManufacturarName, dbo.UnitInfo.UnitName, 
                      dbo.SectionInfo.SectionName, dbo.ProductInfo.FixedAsset, dbo.ProductInfo.Issuable, dbo.ProductSizeLookup.AssetCode
FROM         dbo.ProductInfo INNER JOIN
                      dbo.ProductSizeLookup ON dbo.ProductInfo.PID = dbo.ProductSizeLookup.PID INNER JOIN
                      dbo.ManufacturerInfo ON dbo.ProductSizeLookup.SizeID = dbo.ManufacturerInfo.ManufacturerID INNER JOIN
                      dbo.UnitInfo ON dbo.ProductInfo.UnitId = dbo.UnitInfo.UnitId INNER JOIN
                      dbo.SectionInfo ON dbo.ProductInfo.SectionID = dbo.SectionInfo.SectionID
WHERE     (dbo.ProductInfo.ActivityID = 1) order by dbo.ProductInfo.ProductName";
                }
                else
                {
                    sql = @"SELECT     dbo.ProductSizeLookup.ID, dbo.ProductInfo.PID, dbo.ProductInfo.ProductName, dbo.ManufacturerInfo.ManufacturarName, dbo.UnitInfo.UnitName, 
                      dbo.SectionInfo.SectionName, dbo.ProductInfo.FixedAsset, dbo.ProductInfo.Issuable, dbo.ProductSizeLookup.AssetCode
FROM         dbo.ProductInfo INNER JOIN
                      dbo.ProductSizeLookup ON dbo.ProductInfo.PID = dbo.ProductSizeLookup.PID INNER JOIN
                      dbo.ManufacturerInfo ON dbo.ProductSizeLookup.SizeID = dbo.ManufacturerInfo.ManufacturerID INNER JOIN
                      dbo.UnitInfo ON dbo.ProductInfo.UnitId = dbo.UnitInfo.UnitId INNER JOIN
                      dbo.SectionInfo ON dbo.ProductInfo.SectionID = dbo.SectionInfo.SectionID
WHERE     (dbo.ProductInfo.ActivityID = 1) and dbo.ProductInfo.FixedAsset=" + isFixedAsset + "order by dbo.ProductInfo.ProductName";
                }
                IDbCommand cmd = dbManager.getCommand(CommandType.Text, sql, param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #7
0
        public static DataTable InsertSalesParent(ProductSalesInfo objProductSalesInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

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

                param[0] = dbManager.getparam("@TerminalID", objProductSalesInfo.TerminalID);
                param[1] = dbManager.getparam("@MemoNoteNo", Convert.ToInt64(objProductSalesInfo.MemoNoteNo));
                param[2] = dbManager.getparam("@TotalAmount", Convert.ToDouble(objProductSalesInfo.TotalAmount));
                param[3] = dbManager.getparam("@DiscountAmount", Convert.ToDouble(objProductSalesInfo.DiscountAmount));
                param[4] = dbManager.getparam("@TotalGrossAmount", Convert.ToDouble(objProductSalesInfo.TotalGrossAmount));
                param[5] = dbManager.getparam("@ReceivedAmount", Convert.ToDouble(objProductSalesInfo.ReceivedAmount));
                double ChangeAmount = Convert.ToDouble(objProductSalesInfo.ChangeAmount);
                if (ChangeAmount < 0)
                {
                    ChangeAmount = 0;
                }
                param[6]  = dbManager.getparam("@ChangeAmount", ChangeAmount);
                param[7]  = dbManager.getparam("@CreatedBy", Convert.ToInt64(objProductSalesInfo.CreatedBy));
                param[8]  = dbManager.getparam("@pk_code", "");
                param[9]  = dbManager.getparam("@SalesType", objProductSalesInfo.SalesType);
                param[10] = dbManager.getparam("@CustomerID", objProductSalesInfo.CustomerID);
                param[11] = dbManager.getparam("@SalesReturn", Convert.ToDouble(objProductSalesInfo.SalesReturn));
                param[12] = dbManager.getparam("@RtlManager", objProductSalesInfo.RtlManager);
                param[13] = dbManager.getparam("@ZoneID", objProductSalesInfo.ZoneID);
                param[14] = dbManager.getparam("@CommissionAdjustAmount", Convert.ToDouble(objProductSalesInfo.CommissionAdjustAmount));
                param[15] = dbManager.getparam("@AreaID", Convert.ToInt64(objProductSalesInfo.AreaID));

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_SalesParentInfo_Add]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                //return false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
        public static DataTable InsertUpdate(EmployeeInfo objEmployeeInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 19);
                param[0]  = dbManager.getparam("@EmployeeID", objEmployeeInfo.EmployeeID.ToString());
                param[1]  = dbManager.getparam("@EmployeeName", objEmployeeInfo.EmployeeName.ToString());
                param[2]  = dbManager.getparam("@FathersName", objEmployeeInfo.FathersName.ToString());
                param[3]  = dbManager.getparam("@MothersName", objEmployeeInfo.MothersName.ToString());
                param[4]  = dbManager.getparam("@DepartmentID", objEmployeeInfo.DepartmentID.ToString());
                param[5]  = dbManager.getparam("@DesignationID", objEmployeeInfo.DesignationID.ToString());
                param[6]  = dbManager.getparam("@JoiningDate", objEmployeeInfo.JoiningDate.ToString());
                param[7]  = dbManager.getparam("@BirthDate", objEmployeeInfo.BirthDate.ToString());
                param[8]  = dbManager.getparam("@PresentAddress", objEmployeeInfo.PresentAddress.ToString());
                param[9]  = dbManager.getparam("@PermanentAddress", objEmployeeInfo.PermanentAddress.ToString());
                param[10] = dbManager.getparam("@ContactNo", objEmployeeInfo.ContactNo.ToString());
                param[11] = dbManager.getparam("@Photo", objEmployeeInfo.Photo);
                param[12] = dbManager.getparam("@Gender", objEmployeeInfo.Gender.ToString());
                param[13] = dbManager.getparam("@MaritalStatus", objEmployeeInfo.MaritalStatus.ToString());
                param[14] = dbManager.getparam("@ReferancePersonName", objEmployeeInfo.ReferancePersonName.ToString());
                param[15] = dbManager.getparam("@RelationshipWithRefPerson", objEmployeeInfo.RelationshipWithRefPerson.ToString());
                param[16] = dbManager.getparam("@ReferanceContactNo", objEmployeeInfo.ReferanceContactNo.ToString());
                param[17] = dbManager.getparam("@Activity", objEmployeeInfo.Activity.ToString());
                param[18] = dbManager.getparam("@CreatedBy", objEmployeeInfo.CreatedBy.ToString());

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_EmployeeInfo_InsertUpdate", param);
                dt = dbManager.GetDataTable(cmd);
                //dt = dbManager.ExecuteNonQuery(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
        public static bool Update(BranchInfo objBranchInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

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

                param[0]  = dbManager.getparam("@ActivationDate", objBranchInfo.ActivationDate);
                param[1]  = dbManager.getparam("@ActivityID", objBranchInfo.ActivityID.ToString());
                param[2]  = dbManager.getparam("@Address", objBranchInfo.Address.ToString());
                param[3]  = dbManager.getparam("@BranchCode", objBranchInfo.BranchCode.ToString());
                param[4]  = dbManager.getparam("@BranchName", objBranchInfo.BranchName.ToString());
                param[5]  = dbManager.getparam("@CompanyID", objBranchInfo.CompanyID.ToString());
                param[6]  = dbManager.getparam("@ContactNumber", objBranchInfo.ContactNumber.ToString());
                param[7]  = dbManager.getparam("@UpdatedBy", objBranchInfo.UpdatedBy.ToString());
                param[8]  = dbManager.getparam("@UpdatedDate", objBranchInfo.UpdatedDate);
                param[9]  = dbManager.getparam("@Email", objBranchInfo.Email.ToString());
                param[10] = dbManager.getparam("@ExpireDate", objBranchInfo.ExpireDate);
                param[11] = dbManager.getparam("@FAX", objBranchInfo.FAX.ToString());
                param[12] = dbManager.getparam("@VatRegistrationNo", objBranchInfo.VatRegistrationNo.ToString());
                param[13] = dbManager.getparam("@WebURL", objBranchInfo.WebURL.ToString());
                param[14] = dbManager.getparam("@BranchID", objBranchInfo.BranchID.ToString());


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

                chk = dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return(false);
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
Beispiel #10
0
        public static bool Authontication(string iUserName, string iPassword)
        {
            bool               IsAuthentic = false;
            DataTable          dt          = new DataTable();
            ISalesPOSDBManager dbManager   = new SalesPOSDBManager();
            UserInfo           iUserInfo   = new UserInfo();

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

                param[0] = dbManager.getparam("@user_id", iUserName);
                param[1] = dbManager.getparam("@user_password", iPassword);

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

                dt = dbManager.GetDataTable(cmd);
                if (dt.Rows.Count > 0)
                {
                    bllUtility.LoggedInSystemInformation.LoggedUserId = Convert.ToInt64(dt.Rows[0]["UserInfoId"].ToString());
                    bllUtility.LoggedInSystemInformation.UserName     = dt.Rows[0]["UserName"].ToString();
                    bllUtility.LoggedInSystemInformation.IsAdmin      = Convert.ToBoolean(dt.Rows[0]["IsAdmin"]);
                    IsAuthentic          = true;
                    iUserInfo.UserInfoId = Convert.ToInt64(dt.Rows[0]["UserInfoId"]);
                }
                else
                {
                    IsAuthentic = false;
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(IsAuthentic);
        }
Beispiel #11
0
        public static DataTable Receive_Warrenty_Product(WarrentyService obj)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 17);
                param[0]  = dbManager.getparam("@ProductSizeID", obj.ProductSizeID);
                param[1]  = dbManager.getparam("@Manufacturer", obj.Manufacturer);
                param[2]  = dbManager.getparam("@SerialNo", obj.SerialNo);
                param[3]  = dbManager.getparam("@IsWarrentyApplicable", obj.IsWarrentyApplicable);
                param[4]  = dbManager.getparam("@IsNewFareAdded", obj.IsNewFareAdded);
                param[5]  = dbManager.getparam("@Status", obj.Status);
                param[6]  = dbManager.getparam("@VehicleNo", obj.VehicleNo);
                param[7]  = dbManager.getparam("@CustomerID", obj.CustomerID);
                param[8]  = dbManager.getparam("@CustomerName", obj.CustomerName);
                param[9]  = dbManager.getparam("@Address", obj.Address);
                param[10] = dbManager.getparam("@WarrentyExpiredDate", obj.WarrentyExpiredDate);
                param[11] = dbManager.getparam("@TotalServiceAmount", obj.TotalServiceAmount);
                param[12] = dbManager.getparam("@DiscountAmount", obj.DiscountAmount);
                param[13] = dbManager.getparam("@PaidAmount", obj.PaidAmount);
                param[14] = dbManager.getparam("@ReadyForGatePass", obj.ReadyForGatePass);
                param[15] = dbManager.getparam("@IsPaid", obj.IsPaid);
                param[16] = dbManager.getparam("@CreatedBy", bllUtility.LoggedInSystemInformation.LoggedUserId);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[insert_service_parent]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
        public static bool SoftDefaultSetting()
        {
            bool IsValid = false;
            DataTable dt = new DataTable();
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_SofDefaultSettings]", param);
                dt = dbManager.GetDataTable(cmd);
                if (dt.Rows.Count > 0)
                {
                    IsValid = true;
                    bllUtility.DefaultSettings.ID = dt.Rows[0]["ID"].ToString();
                    bllUtility.DefaultSettings.DefaultSaleType = dt.Rows[0]["DefaultSaleType"].ToString();
                    bllUtility.DefaultSettings.IsEditableSalePrice = dt.Rows[0]["SalesPriceIsEditable"].ToString();
                    bllUtility.DefaultSettings.DiscountAllow = dt.Rows[0]["DiscountAllow"].ToString();
                    bllUtility.DefaultSettings.MiniAccAllow = dt.Rows[0]["MiniAccAllow"].ToString();
                    bllUtility.DefaultSettings.CreditSaleAllow = dt.Rows[0]["CreditSalesAllow"].ToString();
                    bllUtility.DefaultSettings.SalePrintType = dt.Rows[0]["SalesInvoicePrintType"].ToString();
                }
                else
                {
                    IsValid = false;
                }

            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return IsValid;
        }
Beispiel #13
0
        public static DataTable Insert(ProductInfo objProductInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

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

                param[0] = dbManager.getparam("@ActivityID", objProductInfo.ActivityID);
                param[1] = dbManager.getparam("@ProductDescription", objProductInfo.ProductDescription.ToString());
                param[2] = dbManager.getparam("@ProductName", objProductInfo.ProductName.ToString());
                param[3] = dbManager.getparam("@ReorderLevel", objProductInfo.ReorderLevel);
                param[4] = dbManager.getparam("@SectionId", objProductInfo.SectionId);
                param[5] = dbManager.getparam("@SubSectionID", objProductInfo.SubSectionID);
                param[6] = dbManager.getparam("@VatId", objProductInfo.VatId);
                param[7] = dbManager.getparam("@ManufacturerID", objProductInfo.ManufacturerID);
                param[8] = dbManager.getparam("@CreatedBy", objProductInfo.CreatedBy.ToString());
                //param[9]    = dbManager.getparam("@pk_code", "");
                param[9]  = dbManager.getparam("@IsFractionAllow", objProductInfo.IsFractionAllow);
                param[10] = dbManager.getparam("@TypeID", objProductInfo.TypeID);
                param[11] = dbManager.getparam("@OtherCode", objProductInfo.OtherCode.ToString());
                param[12] = dbManager.getparam("@ProductID", objProductInfo.ProductID.ToString());
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_ProductInfo_Add", param);

                //dt = dbManager.ExecuteQuery(cmd);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                //return false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #14
0
        public static bool LogClear()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            bool isLogClear = true;

            try
            {
                dbManager.Open();
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[clearing_db_log]", null);
                dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                isLogClear = false;
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(isLogClear);
        }
Beispiel #15
0
        public static bool Update(ProductInfo objProductInfo, string old_product_code)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 15);
                param[0]  = dbManager.getparam("@ActivityID", objProductInfo.ActivityID);
                param[1]  = dbManager.getparam("@ProductDescription", objProductInfo.ProductDescription.ToString());
                param[2]  = dbManager.getparam("@ProductName", objProductInfo.ProductName);
                param[3]  = dbManager.getparam("@ReorderLevel", objProductInfo.ReorderLevel);
                param[4]  = dbManager.getparam("@SectionId", objProductInfo.SectionId);
                param[5]  = dbManager.getparam("@ProductID", objProductInfo.ProductID);
                param[6]  = dbManager.getparam("@SubSectionID", objProductInfo.SubSectionID);
                param[7]  = dbManager.getparam("@VatId", objProductInfo.VatId.ToString());
                param[8]  = dbManager.getparam("@ManufacturerID", objProductInfo.ManufacturerID.ToString());
                param[9]  = dbManager.getparam("@UpdatedBy", objProductInfo.UpdatedBy.ToString());
                param[10] = dbManager.getparam("@IsFractionAllow", objProductInfo.IsFractionAllow);
                param[11] = dbManager.getparam("@TypeID", objProductInfo.TypeID);
                param[12] = dbManager.getparam("@OtherCode", objProductInfo.OtherCode);
                param[13] = dbManager.getparam("@SerialNo", objProductInfo.SerialNo);
                param[14] = dbManager.getparam("@old_product_code", old_product_code);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_productInfo_Update", param);

                chk = dbManager.ExecuteQuery(cmd);
                //dbManager.ExecuteReader(cmd);
            }
            catch (Exception ex)
            {
                return(false);
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
Beispiel #16
0
        public static bool InsertSalesDetails(ProductSalesDetailsInfo objProductSalesDetailsInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            bool isSave = true;

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

                param[0]  = dbManager.getparam("@InvoiceNo", objProductSalesDetailsInfo.InvoiceNo);
                param[1]  = dbManager.getparam("@ProductID", objProductSalesDetailsInfo.ProductID);
                param[2]  = dbManager.getparam("@ActualQty", bllUtility.Val(objProductSalesDetailsInfo.ActualQty));
                param[3]  = dbManager.getparam("@ActualUnitID", Convert.ToInt64(objProductSalesDetailsInfo.ActualUnitID));
                param[4]  = dbManager.getparam("@ActualUnitSalesPrice", Convert.ToDouble(objProductSalesDetailsInfo.ActualUnitSalesPrice));
                param[5]  = dbManager.getparam("@TotalPriceWithoutVat", Convert.ToDouble(objProductSalesDetailsInfo.TotalPriceWithoutVat));
                param[6]  = dbManager.getparam("@VatID", Convert.ToInt64(objProductSalesDetailsInfo.VatID));
                param[7]  = dbManager.getparam("@VatPerchantage", Convert.ToDouble(objProductSalesDetailsInfo.VatPerchantage));
                param[8]  = dbManager.getparam("@VatAmount", Convert.ToDouble(objProductSalesDetailsInfo.VatAmount));
                param[9]  = dbManager.getparam("@TotalPriceWithVat", Convert.ToDouble(objProductSalesDetailsInfo.TotalPriceWithVat));
                param[10] = dbManager.getparam("@DiscountAmount", Convert.ToDouble(objProductSalesDetailsInfo.DiscountAmount));
                param[11] = dbManager.getparam("@ConvertedUnitID", Convert.ToInt64(objProductSalesDetailsInfo.ConvertedUnitID));
                param[12] = dbManager.getparam("@CovertedQuantity", bllUtility.Val(objProductSalesDetailsInfo.CovertedQuantity));
                param[13] = dbManager.getparam("@ItemType", Convert.ToInt64(objProductSalesDetailsInfo.ItemType));
                param[14] = dbManager.getparam("@DiscountPercent", Convert.ToDouble(objProductSalesDetailsInfo.DiscountPercent));
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_SalesProcess]", param);
                dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                isSave = false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(isSave);
        }
Beispiel #17
0
        public static DataTable GetAccTransDetails(AccountTransaction objAccountTransaction, string AmountTo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                //double AmountSearch = 0.00;
                //if (objAccountTransaction.SearchAmount == "")
                //    AmountSearch = 0.00;
                //else
                //    AmountSearch =Convert.ToDouble(objAccountTransaction.SearchAmount);

                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 8);
                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);
                param[5] = dbManager.getparam("@ref", objAccountTransaction.SearchRef);
                param[6] = dbManager.getparam("@AmountFrom", objAccountTransaction.SearchAmount);
                param[7] = dbManager.getparam("@AmountTo", AmountTo);

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_GetAccTransDetails]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                //return false;
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
        public static bool IsLicenseActive()
        {
            bool IsAuthentic = false;
            DataTable dt = new DataTable();
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_check_license", param);
                dt = dbManager.GetDataTable(cmd);
                if (dt.Rows.Count > 0)
                {
                    IsAuthentic = true;
                    bllUtility.LoggedInSystemInformation.SoftwareName = dt.Rows[0]["SoftwareName"].ToString();
                    bllUtility.LoggedInSystemInformation.LicenseTo = dt.Rows[0]["LicenseTo"].ToString();
                    bllUtility.LoggedInSystemInformation.Version = dt.Rows[0]["Version"].ToString();
                    bllUtility.LoggedInSystemInformation.ActivationDate = dt.Rows[0]["ActivationDate"].ToString();
                    bllUtility.LoggedInSystemInformation.ExpireDate = Convert.ToDateTime(dt.Rows[0]["ExpireDate"].ToString());
                }
                else
                {
                    IsAuthentic = false;
                }

            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return IsAuthentic;
        }
        public static bool Insert(AccountHolderInfo objAccountHolderInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

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

                param[0] = dbManager.getparam("@AccHolderName", objAccountHolderInfo.AccHolderName.ToString());
                param[1] = dbManager.getparam("@AccountHolderTypeID", objAccountHolderInfo.AccountHolderTypeID.ToString());
                //param[2] = dbManager.getparam("@AccountNo", objAccountHolderInfo.AccountNo.ToString());
                param[2] = dbManager.getparam("@ActivityID", objAccountHolderInfo.ActivityID);
                param[3] = dbManager.getparam("@Address", objAccountHolderInfo.Address.ToString());
                param[4] = dbManager.getparam("@ContactNo", objAccountHolderInfo.ContactNo);
                param[5] = dbManager.getparam("@CreatedDate", objAccountHolderInfo.CreatedDate);
                param[6] = dbManager.getparam("@CreatedBy", objAccountHolderInfo.CreatedBy.ToString());
                param[7] = dbManager.getparam("@IsDeleted", false);
                param[8] = dbManager.getparam("@ZoneID", objAccountHolderInfo.ZoneID);
                param[9] = dbManager.getparam("@RSMID", objAccountHolderInfo.RSMID);
                //objAccountHolderInfo.AccountNo.ToString().Substring(3);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_AccountHolderInfo_Add", param);

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

                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
Beispiel #20
0
        public static DataTable GetSalesPrice(string _ProductID, string _UnitID)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.Text, @"SELECT psp.Price as Retail, psp.WholeSalePrice as WholeSale FROM ProductSalesPrice psp WHERE psp.ProductID='" + _ProductID + "' AND psp.UnitID=" + _UnitID + "", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #21
0
        public static DataTable GetAccountTransInfoForMiniAcc()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

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

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_AccountTransInfoForMiniAcc ]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                //return false;
            }
            finally
            {
                dbManager.Dispose();
            }
            return(dt);
        }
        public static DataTable GetVatRegNo()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.Text, @"SELECT bi.VatRegistrationNo FROM BranchInfo bi", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #23
0
        public static DataTable LoadPurpose()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.StoredProcedure, "[USP_LoadPurpose]", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #24
0
        public static DataTable getMenuList()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.Text, @"select distinct MenuID,MenuName,menudescription from  dbo.MasterMenuInfo", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #25
0
        public static DataTable ReportData(string store_procedure)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.Text, store_procedure, param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #26
0
        public static bool Exec_Store_Procedure(string store_procedure)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            bool chk = true;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.Text, store_procedure, param);
                dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                chk = false;
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
Beispiel #27
0
        public static DataTable getAll_Active()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = null;
                IDbCommand         cmd   = dbManager.getCommand(CommandType.Text, @"Select pi.ProductID,pi.ProductName,ai.Activity, pi.SerialNo from dbo.ProductInfo pi left outer join dbo.ActivityInfo ai on ai.ActivityID = pi.ActivityID where pi.IsDeleted = 0 and pi.ActivityID=1 order by pi.ProductName asc", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #28
0
        public static DataTable getReason()
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

            try
            {
                dbManager.Open();

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[GetReasonList]", null);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }
Beispiel #29
0
        public static bool InsertPurchaseMasterDetails(string purchaseID, string productID, string unitID, string purchaseQty, string purchasePrice, string createdBy, string isExpDate, string expDate, int areaId, string UnitPurchasePrice)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

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

                param[0] = dbManager.getparam("@PurchaseID", purchaseID);
                param[1] = dbManager.getparam("@ProductID", productID);
                param[2] = dbManager.getparam("@UnitID", Convert.ToInt32(unitID));
                param[3] = dbManager.getparam("@PurchaseQty", Convert.ToDouble(purchaseQty));
                param[4] = dbManager.getparam("@PurchasePrice", Convert.ToDouble(purchasePrice));
                param[5] = dbManager.getparam("@CreatedBy", Convert.ToInt32(createdBy));
                param[6] = dbManager.getparam("@IsExpDate", isExpDate);
                param[7] = dbManager.getparam("@ProductExpireDate", expDate);
                param[8] = dbManager.getparam("@AreaID", areaId);
                param[9] = dbManager.getparam("@UnitPurchasePrice", Convert.ToDouble(UnitPurchasePrice));

                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_ProductLotDetailsEntry", param);
                dbManager.ExecuteQuery(cmd);
                chk = true;
            }
            catch (Exception ex)
            {
                return(false);

                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
Beispiel #30
0
        public static DataTable getById(string MaterialID)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            DataTable          dt        = new DataTable();

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

                IDbCommand cmd = dbManager.getCommand(CommandType.Text, @"select * from Material_t where MaterialID='" + MaterialID + "'", param);
                dt = dbManager.GetDataTable(cmd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dt.Dispose();
                dbManager.Dispose();
            }
            return(dt);
        }