예제 #1
0
 public IHttpActionResult GetCustomFormat()
 {
     try
     {
         var CustomFormat = this.Repository.GetQuery <AD_tblSetup>().FirstOrDefault();
         if (CustomFormat == null)
         {
             CustomFormat = new AD_tblSetup
             {
                 ID                = Guid.NewGuid(),
                 App_BaseCurrID    = "VND",
                 App_ForgAmtDec    = 0,
                 App_RateExchDec   = 0,
                 App_BaseAmtDec    = 0,
                 App_PercentDec    = 0,
                 App_QuantityDec   = 0,
                 App_UnitCostDec   = 0,
                 App_RF_Color      = "#FF8A8A",
                 App_OF_Color      = "#6495ED",
                 App_AppFontSize   = 9,
                 App_RptFontSize   = 9,
                 App_TitleFontSize = 16
             };
         }
         return(Ok(CustomFormat));
     }
     catch (Exception exp)
     {
         return(BadRequest(exp.ToString()));
     }
 }
예제 #2
0
 public IHttpActionResult Save(AD_tblSetup Setup)
 {
     try
     {
         this.Repository.AddOrUpdate(Setup);
         this.Repository.UnitOfWork.SaveChanges();
         return(Ok());
     }
     catch (Exception exp)
     {
         return(BadRequest(exp.ToString()));
     }
 }
예제 #3
0
        public IHttpActionResult Get()
        {
            try
            {
                var Setup = this.Repository.GetQuery <AD_tblSetup>().FirstOrDefault();
                if (Setup == null)
                {
                    Setup = new AD_tblSetup()
                    {
                        ID = Guid.NewGuid()
                    }
                }
                ;

                return(Ok(Setup));
            }
            catch (Exception exp)
            {
                return(BadRequest(exp.ToString()));
            }
        }