Exemplo n.º 1
0
        public JsonResult submitAgentTourCommissions(List <AgentTourCommission> obj)
        {
            try
            {
                var rep = new AgentTourCommissionRepository();

                foreach (var ob in obj)
                {
                    if (ob.Commission != null)
                    {
                        var temp = rep.Get(ob.UserID, ob.TourCodeID);
                        if (temp.Commission != 0 && temp.Commission != null)
                        {
                            //ob.active_f = 1;  //on 08-04-2015
                            rep.Update(ob);
                        }
                        else
                        {
                            //ob.active_f = 1; //on 08-04-2015
                            if (ob.active_f == 1)
                            {
                                rep.Insert(ob);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                return(Json(ex.Message + " " + ex.InnerException));
            }
            return(Json(true));
        }
Exemplo n.º 2
0
        public JsonResult getAgentTourCommission(AgentTourCommission obj)
        {
            var repository = new AgentTourCommissionRepository();
            var result     = repository.Get(obj.UserID, obj.TourCodeID);

            if (result.Commission != null && result.Commission != 0)
            {
                return(Json(result.Commission));
            }
            else
            {
                var rep = new BookingRepository();
                return(Json(rep.GetCommission(obj.UserID)));
            }
        }