Exemple #1
0
        public static bool IsForFiscal(int controlID)
        {
            SpecialFieldType           sft     = SpecialFieldType.GetByCode(SpecialFieldType.FISCAL);
            List <ControlsSpecialType> cstList = Table.Where(c => c.SpecialFieldTypeID == sft.ID && c.ControlID == controlID && c.IsActive == true).ToList();

            return(cstList.Count != 0);
        }
Exemple #2
0
        public static List <Control> SelectSearchParametersExtend(int insuranceSubTypeID)
        {
            List <Control>   retList      = new List <Control>();
            SpecialFieldType sft          = SpecialFieldType.GetByCode(SpecialFieldType.SEARCH);
            Control          dummyControl = new Control();

            dummyControl.ID        = 0;
            dummyControl.LabelName = "Број на полиса";
            retList.Add(dummyControl);
            Control dummyControlEMBGClient = new Control();

            dummyControlEMBGClient.ID        = -1;
            dummyControlEMBGClient.LabelName = "ЕМБГ Дог.";
            retList.Add(dummyControlEMBGClient);
            Control dummyControlEMBGOwner = new Control();

            dummyControlEMBGOwner.ID        = -2;
            dummyControlEMBGOwner.LabelName = "ЕМБГ Оси.";
            retList.Add(dummyControlEMBGOwner);
            //List<Control> searchControlsList = Table.Where(c => c.InsuranceSubTypeID == insuranceSubTypeID && c.IsActive == true && c.SpecialFieldTypeID == sft.ID).ToList();
            List <Control> searchControlsList = ControlsSpecialType.Table.Where(c => c.Control.InsuranceSubTypeID == insuranceSubTypeID && c.IsActive == true && c.SpecialFieldTypeID == sft.ID).Select(c => c.Control).ToList();

            retList.AddRange(searchControlsList);
            return(retList);
        }
Exemple #3
0
        public static List <Control> GetForFiscalByInsuranceSubType(int insuranceSubTypeID)
        {
            SpecialFieldType sft          = SpecialFieldType.GetByCode(SpecialFieldType.FISCAL);
            List <Control>   controlsList = Table.Where(c => c.InsuranceSubTypeID == insuranceSubTypeID && c.IsActive == true).ToList();
            List <Control>   returnList   = new List <Control>();

            foreach (Control c in controlsList)
            {
                if (ControlsSpecialType.IsForFiscal(c.ID))
                {
                    returnList.Add(c);
                }
            }
            return(returnList);
            //return Table.Where(c => c.InsuranceSubTypeID == insuranceSubTypeID && c.SpecialFieldTypeID == sft.ID).ToList();
        }
Exemple #4
0
        public static List <string> GetForFiscalBill(int policyID)
        {
            Policy p = Policy.Get(policyID);

            char[]        separator   = { ' ', '#', ';' };
            List <string> returnList  = new List <string>();
            string        startString = "01,0000,1";

            startString += separator[2];
            returnList.Add(startString);
            SpecialFieldType sft = SpecialFieldType.GetByCode(SpecialFieldType.FISCAL);
            int i = 0;

            foreach (PolicyItem pi in p.PolicyItems)
            {
                char   currentSeparator = separator[i % 2];
                string s = currentSeparator.ToString() + pi.InsuranceSubType.ShortDescription;
                s += '\t';
                s += pi.PremiumValue;
                s += separator[2].ToString();
                returnList.Add(s);
                ++i;
                List <Control> controlsList = Control.GetForFiscalByInsuranceSubType(pi.InsuranceSubTypeID);
                foreach (Control c in controlsList)
                {
                    currentSeparator = separator[i % 2];
                    s  = currentSeparator.ToString() + c.Description;
                    s += '\t';
                    PolicyExtendInformation pei = PolicyExtendInformation.GetByPolicyItemAndControl(pi.ID, c.ID);
                    s += String.Format("{0:#,0.00}", pei.Value);
                    s += separator[2].ToString();
                    returnList.Add(s);
                    i++;
                }
            }
            string lastString = "%8";

            returnList.Add(lastString);
            return(returnList);
        }
Exemple #5
0
        public static List <Control> SelectSearchParameters(int insuranceSubTypeID)
        {
            SpecialFieldType sft = SpecialFieldType.GetByCode(SpecialFieldType.SEARCH);

            return(Table.Where(c => c.InsuranceSubTypeID == insuranceSubTypeID && c.IsActive == true && c.SpecialFieldTypeID == sft.ID).ToList());
        }
Exemple #6
0
        public static List <Control> GetForReportByInsuranceSubType(int insuranceSubTypeID)
        {
            SpecialFieldType sft = SpecialFieldType.GetByCode(SpecialFieldType.REPORT);

            return(Table.Where(c => c.InsuranceSubTypeID == insuranceSubTypeID && c.SpecialFieldTypeID == sft.ID).ToList());
        }