Ejemplo n.º 1
0
        public bool ValidateUser(string connectionString, string username, string password)
        {
            DataTable dt   = null;
            bool      _ret = false;

            try
            {
                SqlParameter[] parameters =
                {
                    new SqlParameter("@username",                   username),
                    new SqlParameter("@password",                   Utility.Tools.Encrypt(password)),
                    SqlAccessor.SqlParameterBuilder("@returnValue", SqlDbType.Int, ParameterDirection.Output)
                };

                dt = SqlAccessor.ExecuteDataSet(connectionString, SqlAccessor.SqlCommandBuilder(new SqlCommand(PL_VALIDATEUSER_SP), parameters), CommandType.StoredProcedure, "").Tables[0];
                if (Convert.ToInt32(dt.Rows[0][0]) != 0)
                {
                    _ret = true;
                }
            }
            catch (Exception exc)
            {
                //ErrorLog.Log(APLU_NAME, "GetAll():" + exc.Message);
            }
            return(_ret);
        }
Ejemplo n.º 2
0
        public DataTable GetTrdpCode(string connectionString, string username)
        {
            DataTable dt = null;

            try
            {
                SqlParameter[] parameters =
                {
                    new SqlParameter("@username",                   username),
                    SqlAccessor.SqlParameterBuilder("@returnValue", SqlDbType.Int, ParameterDirection.Output)
                };

                dt = SqlAccessor.ExecuteDataSet(connectionString, SqlAccessor.SqlCommandBuilder(new SqlCommand(PL_GETTRDPCODE_SP), parameters), CommandType.StoredProcedure, "").Tables[0];
            }
            catch (Exception exc)
            {
                //ErrorLog.Log(APLU_NAME, "GetAll():" + exc.Message);
            }
            return(dt);
        }
Ejemplo n.º 3
0
        public void ProcessLog(string connectionString, string processSource, bool isSuccess, string description, string technicalError)
        {
            DataTable dt = null;

            try
            {
                SqlParameter[] parameters =
                {
                    new SqlParameter("@prlgProcessSource",          processSource),
                    new SqlParameter("@prlgIsSuccess",              isSuccess),
                    new SqlParameter("@prlgDescription",            description),
                    new SqlParameter("@prlgTechnicalErrDesc",       technicalError),
                    SqlAccessor.SqlParameterBuilder("@returnValue", SqlDbType.Int, ParameterDirection.Output)
                };

                dt = SqlAccessor.ExecuteDataSet(connectionString, SqlAccessor.SqlCommandBuilder(new SqlCommand(PL_PROCESSLOG_SP), parameters), CommandType.StoredProcedure, "").Tables[0];
            }
            catch (Exception exc)
            {
                //ErrorLog.Log(APLU_NAME, "GetAll():" + exc.Message);
            }
        }
Ejemplo n.º 4
0
        public List <RequeueFile> GetEveryRequeueFile()
        {
            string tableName = "RequeueFile";

            SqlCommand cmd = BuildGetEveryRequeueFileCommand();

            DataSet ds = SqlAccessor.ExecuteDataSet(Config.GetAppSettingsValue("DBConnectionString", ""),
                                                    cmd, CommandType.StoredProcedure, tableName);

            List <RequeueFile> entities = new List <RequeueFile>();

            if (ds != null)
            {
                DataTable dt = ds.Tables[0];

                foreach (DataRow drow in dt.Rows)
                {
                    RequeueFile theRequeueFile = new RequeueFile();
                    theRequeueFile.RequeueFileId            = Convert.ToInt32(drow["RequeueFileId"]);
                    theRequeueFile.trdpCode                 = Convert.ToString(drow["trdpCode"]);
                    theRequeueFile.MsgCode                  = Convert.ToString(drow["MsgCode"]);
                    theRequeueFile.SourceFileName           = Convert.ToString(drow["SourceFileName"]);
                    theRequeueFile.OutputFileName           = Convert.ToString(drow["OutputFileName"]);
                    theRequeueFile.CreateDate               = Convert.ToDateTime(drow["CreateDate"]);
                    theRequeueFile.UpdateDate               = (drow["UpdateDate"] == DBNull.Value ? DateTime.MinValue : Convert.ToDateTime(drow["UpdateDate"]));
                    theRequeueFile.IsActive                 = Convert.ToBoolean(drow["IsActive"]);
                    theRequeueFile.ERP                      = Convert.ToString(drow["ERP"]);
                    theRequeueFile.MsetBackUpFolder         = Convert.ToString(drow["MsetBackUpFolder"]);
                    theRequeueFile.MessageFileDestinationId = Convert.ToInt32(drow["MessageFileDestinationId"]);
                    theRequeueFile.TransmissionTypeCode     = Convert.ToString(drow["TransmissionTypeCode"]);
                    theRequeueFile.TempExtension            = Convert.ToString(drow["TempExtension"]);
                    entities.Add(theRequeueFile);
                }
            }

            return(entities);
        }