Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Can';不要将条目添加到存储库中_C#_Jquery_Asp.net Mvc 3_Jquery Ui_Postgresql - Fatal编程技术网

C# Can';不要将条目添加到存储库中

C# Can';不要将条目添加到存储库中,c#,jquery,asp.net-mvc-3,jquery-ui,postgresql,C#,Jquery,Asp.net Mvc 3,Jquery Ui,Postgresql,我有一个db和ET数据库模型。我使用PostgreSQL 当我试图将条目添加到网格时,什么都没有发生。但删除和编辑的工作很好。 我该怎么办 谢谢 这是控制器代码 public ActionResult GetFormForAddOrEdit(string id) { if (string.IsNullOrEmpty(id)) { return PartialView(new TypeDictModel()); }

我有一个db和ET数据库模型。我使用PostgreSQL

当我试图将条目添加到网格时,什么都没有发生。但删除和编辑的工作很好。 我该怎么办

谢谢

这是控制器代码

 public ActionResult GetFormForAddOrEdit(string id)
    {
        if (string.IsNullOrEmpty(id))
        {
            return PartialView(new TypeDictModel());
        }
        else
        {
            TypeDict td = typeDictRepo.GetById(id);
            TypeDictModel tdt = new TypeDictModel() { Oid = td.Oid, FormOfProduction = td.FormOfProduction };
            return PartialView(tdt);
        }
    }


    public virtual string SaveTypeDictEntry(TypeDictModel tdm)
    {
        string newTDE = typeDictRepo.Save(tdm.Oid, tdm.FormOfProduction);
        return newTDE;
    }


    public virtual void DeleteEntry(string id)
    {
        typeDictRepo.Delete(id);
    }
这里是视图

    function CloseTypeDictModal() {
    $('#EditTypeDictModal_Close').click();
}

function SaveNewEntry() {
    $.ajax({
        url: '@Url.Action("SaveTypeDictEntry", "TypeDict")',
        async: true,
        dataType: "html",
        type: 'POST',
        data: $('#TypeDictForm').serialize(),
        success: function (data) {

            CloseTypeDictModal();
            $('#newTypeDictGrid').jqGrid().trigger("reloadGrid");
        }
    });
} 

修复了我的存储。缺少此行上下文。SaveChanges();^

你的保存方法在仓库里做什么?您是否使用断点来查看发生了什么?是否可以定义NotWorks?预期结果是什么?实际结果是什么?这是我的