Ejemplo n.º 1
0
 public CompanyRegulation(int companyReguId, ReguType reguType, string title, string content)
     : this(reguType)
 {
     _CompanyRegulationsID = companyReguId;
     _Title   = title;
     _Content = content;
 }
Ejemplo n.º 2
0
        public CompanyRegulation GetCompanyRegulationsByType(ReguType type)
        {
            CompanyRegulation companyRegulations = null;
            SqlCommand        cmd = new SqlCommand();

            cmd.Parameters.Add(_ReguType, SqlDbType.Int).Value = type;

            using (SqlDataReader sdr = SqlHelper.ExecuteReader("GetCompanyRegulationsByType", cmd))
            {
                while (sdr.Read())
                {
                    string content = String.Empty;

                    if (sdr[_DbContent] != DBNull.Value)
                    {
                        content = sdr[_DbContent].ToString();
                    }

                    companyRegulations = new CompanyRegulation(
                        Convert.ToInt32(sdr[_DbCompanyRegulationsID]),
                        (ReguType)sdr[_DbReguType],
                        sdr[_DbTitle].ToString(),
                        content);

                    companyRegulations.AppendixList = GetCompanyReguAppendixByCompanyRegulationsID(companyRegulations.CompanyRegulationsID);
                }
            }

            if (companyRegulations == null)
            {
                companyRegulations = new CompanyRegulation(type);
            }
            return(companyRegulations);
        }
Ejemplo n.º 3
0
        public CompanyRegulation GetCompanyRegulationsByType(ReguType type, Account loginUser)
        {
            CompanyRegulation companyRegulations = DalInstance.CompanyRegulationDalInstance.GetCompanyRegulationsByType(type);

            if (companyRegulations.AppendixList != null)
            {
                for (int i = companyRegulations.AppendixList.Count - 1; i >= 0; i--)
                {
                    if (!System.IO.File.Exists(companyRegulations.AppendixList[i].Directory))
                    {
                        DalInstance.CompanyRegulationDalInstance.DeleteCompanyReguAppendixByPKID(companyRegulations.AppendixList[i].AppendixID);
                        companyRegulations.AppendixList.RemoveAt(i);
                    }
                }
            }
            return(companyRegulations);
        }
Ejemplo n.º 4
0
 public CompanyRegulation(ReguType reguType)
 {
     _ReguType     = reguType;
     _AppendixList = new List <CompanyReguAppendix>();
 }