示例#1
0
        public int CustomFormat_Save(BLL.CustomFormat agp)
        {
            try
            {
                agp.FundMasterId = Caller.FundMasterId;
                DAL.CustomFormat d = DB.CustomFormats.Where(x => x.Id == agp.Id).FirstOrDefault();

                if (d == null)
                {
                    d = new DAL.CustomFormat();
                    DB.CustomFormats.Add(d);

                    agp.toCopy <DAL.CustomFormat>(d);
                    DB.SaveChanges();

                    agp.Id = d.Id;
                    LogDetailStore(agp, LogDetailType.INSERT);
                }
                else
                {
                    agp.toCopy <DAL.CustomFormat>(d);
                    DB.SaveChanges();
                    LogDetailStore(agp, LogDetailType.UPDATE);
                }

                Clients.Clients(OtherLoginClientsOnGroup).CustomFormat_Save(agp);

                return(agp.Id);
            }
            catch (Exception ex) { }
            return(0);
        }
        private void CurrencySetup(CompanyDetail cm)
        {
            if (cm.UnderCompanyId == 0 || cm.UnderCompanyId == null)
            {
                DAL.CustomFormat cf = new DAL.CustomFormat();
                cf.CompanyId = cm.Id;
                cf.CurrencyPositiveSymbolPrefix = "RM";
                cf.CurrencyPositiveSymbolSuffix = "RM";
                cf.CurrencyNegativeSymbolPrefix = "RM";
                cf.CurrencyNegativeSymbolSuffix = "RM";
                cf.CurrencyToWordPrefix         = "Ringgit";
                cf.CurrencyToWordSuffix         = "Ringgit";
                cf.DecimalToWordPrefix          = "Cent";
                cf.DecimalToWordSuffix          = "Cent";
                cf.DigitGroupingBy           = 2;
                cf.CurrencyCaseSensitive     = 2;
                cf.DecimalSymbol             = ".";
                cf.DigitGroupingSymbol       = ",";
                cf.IsDisplayWithOnlyOnSuffix = true;
                cf.NoOfDigitAfterDecimal     = 2;

                DB.CustomFormats.Add(cf);
                DB.SaveChanges();
            }
        }
示例#3
0
 BLL.CustomFormat CustomFormatDAL_BLL(DAL.CustomFormat d)
 {
     BLL.CustomFormat b = d.toCopy <BLL.CustomFormat>(new BLL.CustomFormat());
     b.Fund = d.FundMaster == null ? new BLL.FundMaster() : d.FundMaster.toCopy <BLL.FundMaster>(new BLL.FundMaster());
     return(b);
 }
示例#4
0
 BLL.CustomFormat CustomFormatDAL_BLL(DAL.CustomFormat d)
 {
     BLL.CustomFormat b = d.toCopy <BLL.CustomFormat>(new BLL.CustomFormat());
     b.Company = d.CompanyDetail == null ? new BLL.CompanyDetail() : d.CompanyDetail.toCopy <BLL.CompanyDetail>(new BLL.CompanyDetail());
     return(b);
 }