public async Task<ActionResult> Save([Bind(Include = "Id,ChargesId,TimeFrom,TimeTo,ApplyAtId,ChargesTypeId,Enabled,Charges,EnteredDate,EnteredbyUserId,ModifyDate,ModifiedByUserId")]Billing_Rules billing_rules)
        {

            if (ModelState.IsValid)
            {


                if (billing_rules.Id == 0)
                {
                    billing_rules.EnteredbyUserId = int.Parse(System.Web.HttpContext.Current.Session["UserID"].ToString());
                    _Billing_RuleRepository.Create(billing_rules);
                }
                else
                {
                    billing_rules.ModifiedByUserId  = int.Parse(System.Web.HttpContext.Current.Session["UserID"].ToString());
                   
                    _Billing_RuleRepository.Update(billing_rules, billing_rules.Id.ToString ());
                }

            }
            else
            {
             await   GetType(billing_rules);
                var rules = await _Billing_RuleRepository.GetAll();
                Billing_RulesViewModel model = new Billing_RulesViewModel { List = rules, Billing_Rule = billing_rules };
                 return View("Index", model);
            }
            return RedirectToAction("Index");
        }
        public async Task<ActionResult> Index(int? Id)
        {
            Billing_Rules billing_rules = new Billing_Rules();
            if (Id != null)
                billing_rules =await _Billing_RuleRepository.GetById(Id.Value.ToString ());

            await GetType(billing_rules);
            var list =await _Billing_RuleRepository.GetAll();

            Billing_RulesViewModel model = new Billing_RulesViewModel { List = list, Billing_Rule = billing_rules };
            return View(model);
        }