Example #1
0
        public static DataSet Get24hrsSalesStockReportDataTable(string userID, DateTime fromDate, DateTime toDate, string branchCode)
        {
            ScopeRepository scopeRepository = new ScopeRepository();

            // As we  cannot instantiate a DbCommand because it is an abstract base class created from the repository with context connection.
            using DbCommand command = scopeRepository.CreateCommand();
            command.CommandType     = CommandType.StoredProcedure;
            command.CommandText     = "Usp_StockReport";

            #region Parameters
            DbParameter UserID = command.CreateParameter();
            UserID.Direction     = ParameterDirection.Input;
            UserID.Value         = (object)userID ?? DBNull.Value;
            UserID.ParameterName = "UserID";
            DbParameter dbpBranchCode = command.CreateParameter();
            dbpBranchCode.Direction     = ParameterDirection.Input;
            dbpBranchCode.Value         = (object)branchCode ?? DBNull.Value;
            dbpBranchCode.ParameterName = "branchCode";
            DbParameter pmFromDate = command.CreateParameter();
            pmFromDate.Direction     = ParameterDirection.Input;
            pmFromDate.Value         = (object)fromDate ?? DBNull.Value;
            pmFromDate.ParameterName = "fromDate";
            DbParameter pmToDate = command.CreateParameter();
            pmToDate.Direction     = ParameterDirection.Input;
            pmToDate.Value         = (object)toDate ?? DBNull.Value;
            pmToDate.ParameterName = "toDate";
            #endregion
            // Add parameter as specified in the store procedure
            command.Parameters.Add(UserID);
            command.Parameters.Add(dbpBranchCode);
            command.Parameters.Add(pmFromDate);
            command.Parameters.Add(pmToDate);
            return(scopeRepository.ExecuteParamerizedCommand(command));
        }
Example #2
0
        public static DataTable GetEmployeeRegisterReportDataTable(string userID)
        {
            ScopeRepository scopeRepository = new ScopeRepository();

            // As we  cannot instantiate a DbCommand because it is an abstract base class created from the repository with context connection.
            using DbCommand command = scopeRepository.CreateCommand();
            command.CommandType     = CommandType.StoredProcedure;
            command.CommandText     = "Usp_GetEmployeeRegisterReport";
            #region Parameters
            DbParameter UserID = command.CreateParameter();
            UserID.Direction     = ParameterDirection.Input;
            UserID.Value         = (object)userID ?? DBNull.Value;
            UserID.ParameterName = "UserID";
            #endregion
            // Add parameter as specified in the store procedure
            command.Parameters.Add(UserID);
            DataTable dt = scopeRepository.ExecuteParamerizedCommand(command).Tables[0];
            if (dt.Rows.Count > 0)
            {
                return(dt);
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        public static DataTable GetDailySalesReportDataTable(string companyId, string branchName, string userName)
        {
            ScopeRepository scopeRepository = new ScopeRepository();

            // As we  cannot instantiate a DbCommand because it is an abstract base class created from the repository with context connection.
            using DbCommand command = scopeRepository.CreateCommand();
            command.CommandType     = CommandType.StoredProcedure;
            command.CommandText     = "Usp_GetDailySalesReport";
            #region Parameters
            DbParameter pmcompanyId = command.CreateParameter();
            pmcompanyId.Direction     = ParameterDirection.Input;
            pmcompanyId.Value         = (object)companyId ?? DBNull.Value;
            pmcompanyId.ParameterName = "companyId";

            DbParameter pmbranchID = command.CreateParameter();
            pmbranchID.Direction     = ParameterDirection.Input;
            pmbranchID.Value         = (object)branchName ?? DBNull.Value;
            pmbranchID.ParameterName = "branchCode";

            DbParameter pmuserName = command.CreateParameter();
            pmuserName.Direction     = ParameterDirection.Input;
            pmuserName.Value         = (object)userName ?? DBNull.Value;
            pmuserName.ParameterName = "userName";

            DbParameter pmfDate = command.CreateParameter();
            pmfDate.Direction     = ParameterDirection.Input;
            pmfDate.Value         = (object)DateTime.Now ?? DBNull.Value;
            pmfDate.ParameterName = "fDate";

            DbParameter pmtDate = command.CreateParameter();
            pmtDate.Direction     = ParameterDirection.Input;
            pmtDate.Value         = (object)DateTime.Now ?? DBNull.Value;
            pmtDate.ParameterName = "tDate";



            #endregion
            // Add parameter as specified in the store procedure
            command.Parameters.Add(pmcompanyId);
            command.Parameters.Add(pmbranchID);
            command.Parameters.Add(pmfDate);
            command.Parameters.Add(pmtDate);
            command.Parameters.Add(pmuserName);
            DataTable dt = scopeRepository.ExecuteParamerizedCommand(command).Tables[0];
            if (dt.Rows.Count > 0)
            {
                return(dt);
            }
            else
            {
                return(null);
            }
        }
Example #4
0
        public static string SalaryProcess(string Year, string Month, string CompanyCode, string EmpCode, string Status)
        {
            ScopeRepository scopeRepository = new ScopeRepository();

            using DbCommand command = scopeRepository.CreateCommand();
            command.CommandType     = CommandType.StoredProcedure;
            command.CommandText     = "Salary_Process_EmpWise";
            #region Parameters
            DbParameter year        = command.CreateParameter();
            DbParameter month       = command.CreateParameter();
            DbParameter companycode = command.CreateParameter();
            DbParameter empCode     = command.CreateParameter();
            DbParameter status      = command.CreateParameter();
            year.Direction            = ParameterDirection.Input;
            month.Direction           = ParameterDirection.Input;
            companycode.Direction     = ParameterDirection.Input;
            empCode.Direction         = ParameterDirection.Input;
            status.Direction          = ParameterDirection.Input;
            year.Value                = (object)Year ?? DBNull.Value;
            month.Value               = (object)Month ?? DBNull.Value;
            companycode.Value         = (object)CompanyCode ?? DBNull.Value;
            empCode.Value             = (object)EmpCode ?? DBNull.Value;
            status.Value              = (object)Status ?? DBNull.Value;
            year.ParameterName        = "pYear";
            month.ParameterName       = "pMonth";
            companycode.ParameterName = "pCompanyCode";
            empCode.ParameterName     = "pEmpCode";
            status.ParameterName      = "pStatus";
            #endregion
            // Add parameter as specified in the store procedure
            command.Parameters.Add(year);
            command.Parameters.Add(month);
            command.Parameters.Add(companycode);
            command.Parameters.Add(empCode);
            command.Parameters.Add(status);
            DataTable dt = scopeRepository.ExecuteParamerizedCommand(command).Tables[0];
            return(null);
        }
Example #5
0
        public static DataSet getDataFromDataBase(List <parametersClass> dbParametersList, string procedureName)
        {
            DataSet         ds = null;
            ScopeRepository scopeRepository = new ScopeRepository();

            using (DbCommand command = scopeRepository.CreateCommand())
            {
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = procedureName;
                #region Parameters
                foreach (parametersClass dbPar in dbParametersList)
                {
                    DbParameter dbParameter = command.CreateParameter();
                    dbParameter.Direction     = ParameterDirection.Input;
                    dbParameter.Value         = (object)dbPar.paramValue ?? DBNull.Value;
                    dbParameter.ParameterName = dbPar.paramName;
                    command.Parameters.Add(dbParameter);
                }
                #endregion
                ds = scopeRepository.ExecuteParamerizedCommand(command);
            }
            return(ds);
        }
Example #6
0
        public static DataSet GetIntimateSaleReportDataSet(string ledgerCode, DateTime fromDate, DateTime toDate, string UserID)
        {
            ScopeRepository scopeRepository = new ScopeRepository();

            // As we  cannot instantiate a DbCommand because it is an abstract base class created from the repository with context connection.
            using DbCommand command = scopeRepository.CreateCommand();
            command.CommandType     = CommandType.StoredProcedure;
            command.CommandText     = "Usp_GetIntimateSaleReport";
            #region Parameters
            DbParameter pmledgerCode = command.CreateParameter();
            pmledgerCode.Direction     = ParameterDirection.Input;
            pmledgerCode.Value         = (object)ledgerCode ?? DBNull.Value;
            pmledgerCode.ParameterName = "ledgerCode";

            DbParameter pmfDate = command.CreateParameter();
            pmfDate.Direction     = ParameterDirection.Input;
            pmfDate.Value         = (object)fromDate ?? DBNull.Value;
            pmfDate.ParameterName = "fromDate";

            DbParameter pmtDate = command.CreateParameter();
            pmtDate.Direction     = ParameterDirection.Input;
            pmtDate.Value         = (object)toDate ?? DBNull.Value;
            pmtDate.ParameterName = "toDate";

            DbParameter pmuserName = command.CreateParameter();
            pmuserName.Direction     = ParameterDirection.Input;
            pmuserName.Value         = (object)UserID ?? DBNull.Value;
            pmuserName.ParameterName = "UserID";

            #endregion
            // Add parameter as specified in the store procedure
            command.Parameters.Add(pmledgerCode);
            command.Parameters.Add(pmfDate);
            command.Parameters.Add(pmtDate);
            command.Parameters.Add(pmuserName);
            return(scopeRepository.ExecuteParamerizedCommand(command));
        }