public int ProcessOrder([FromBody] insurance_client insurance)
 {
     //اگر قبلا رکورد این سفارش ثبت شده همان را بردار
     if (insurance.orderId > 0)
     {
         order order = this.repository.GetOrder(insurance.orderId);
         this.repository.MapInsuranceToOrder(order, insurance);
         return(order.id);
     }
     //اگر سفارش جدید است برای آن رکورد جدید ایجاد کن
     //باید چک شود که لاگین هستیم یا نه
     //else if (this.repository.GetUserId() > 0)
     else
     {
         int orderId = repository.AddOrder(insurance);
         return(orderId);
     }
     //از اینجا به بعد مال قبله
     //int orderId = repository.AddOrder(insurance);
     ////چون یوزر را میخواهیم مجبوریم این کار را بکنیم
     //order order = this.repository.GetOrder(orderId);
     //this.hookManager.HookFired("orderAdded", order.user, order);
     //return orderId;
     return(0);
 }
        public int AddOrder([FromBody] insurance_client insurance)
        {
            int orderId = repository.AddOrder(insurance);
            //چون یوزر را میخواهیم مجبوریم این کار را بکنیم
            order order = this.repository.GetOrder(orderId);

            this.hookManager.HookFired("orderAdded", order.user, order);
            return(orderId);
        }