public ActionResult DicUpdate([DataSourceRequest] DataSourceRequest request, OBKReferenceContractDocTypeModel dictionary,
                                      string type)
        {
            if (dictionary != null && ModelState.IsValid)
            {
                OBK_Ref_ContractDocumentType d = db.OBK_Ref_ContractDocumentType.First(o => o.Id == dictionary.Id);
                d.NameRu         = dictionary.NameRu;
                d.NameKz         = dictionary.NameKz;
                d.NameGenitiveRu = dictionary.NameGenitiveRu;
                d.NameGenitiveKz = dictionary.NameGenitiveKz;
                db.SaveChanges();
            }

            return(Json(new[] { dictionary }.ToDataSourceResult(request, ModelState)));
        }
        public ActionResult DicCreate([DataSourceRequest] DataSourceRequest request, OBKReferenceContractDocTypeModel dictionary,
                                      string type)
        {
            if (dictionary != null && ModelState.IsValid)
            {
                OBK_Ref_ContractDocumentType d = new OBK_Ref_ContractDocumentType()
                {
                    Id             = Guid.NewGuid(),
                    NameRu         = dictionary.NameRu,
                    NameKz         = dictionary.NameKz,
                    NameGenitiveRu = dictionary.NameGenitiveRu,
                    NameGenitiveKz = dictionary.NameGenitiveKz
                };
                db.OBK_Ref_ContractDocumentType.Add(d);
                db.SaveChanges();
                dictionary.Id = d.Id;
            }

            return(Json(new[] { dictionary }.ToDataSourceResult(request, ModelState)));
        }
        public ActionResult DicDestroy([DataSourceRequest] DataSourceRequest request, OBKReferenceContractDocTypeModel dictionary,
                                       string type)
        {
            if (dictionary != null)
            {
                OBK_Ref_ContractDocumentType d = db.OBK_Ref_ContractDocumentType.First(o => o.Id == dictionary.Id);
                db.OBK_Ref_ContractDocumentType.Remove(d);
                db.SaveChanges();
            }

            return(Json(new[] { dictionary }.ToDataSourceResult(request, ModelState)));
        }