public async Task <ActionResult> Update(DocumentNumberUpdateViewModel data)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    data.active           = true;
                    data.modifiedDateTime = DateTime.Now;
                    data.modifiedBy       = Session["user_id"].ToString();
                    var postTask = await client.PostAsJsonAsync("/api/DocumentNumber/Update", data);

                    if (postTask.IsSuccessStatusCode)
                    {
                        return(Json(true, JsonRequestBehavior.DenyGet));
                    }
                }
                catch (Exception e)
                {
                    return(Json(e.Message, JsonRequestBehavior.DenyGet));
                }
            }
            return(Json(false, JsonRequestBehavior.DenyGet));
        }
        public async Task <ActionResult> Edit(string comp_id, string doc_id)
        {
            if (comp_id != null && doc_id != null)
            {
                DocumentNumberUpdateViewModel model = new DocumentNumberUpdateViewModel();
                var postTask = await client.GetAsync("/api/DocumentNumber/View/?comp_id=" + comp_id + "&doc_id=" + doc_id);

                model = await postTask.Content.ReadAsAsync <DocumentNumberUpdateViewModel>();

                if (model != null)
                {
                    return(View("Edit", model));
                }
                else
                {
                    DocumentNumberIndexViewModel data = new DocumentNumberIndexViewModel();
                    ViewBag.Error = "No Document Found !";
                    return(View("Index", data));
                }
            }

            return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
        }