public AjaxRspJson isexist_Obj(string Language, string obj_code) { try { Isexist_Obj isexist_Obj = _objectCreate.Isexist_Obj(obj_code, Language); return(new AjaxRspJson { RspCode = RspStatus.Successed, ObjectData = isexist_Obj, RspMsg = "" }); } catch (Exception ex) { return(new AjaxRspJson { RspCode = RspStatus.Failed, ObjectData = null, RspMsg = ex.Message }); } }
public static Isexist_Obj isexist_Obj(string obj_code, string Language) { try { string is_exit = "select * from flc_object where obj_code='" + obj_code + "'"; object o = AppDataBase.ExecuteScalar(is_exit); if (o == null || o.ToString() == string.Empty) { is_exit = "1"; } else { is_exit = "0"; } string all_object = @"select obj_code,value from flc_object t left join flc_lang e on t.obj_code=e.key and e.lan='" + Language + "'"; List <Allobj> allobjs = AppDataBase.Query <Allobj>(all_object).ToList(); Allobj allobj = new Allobj(); allobj.Obj_Code = obj_code; allobj.Value = "当前对象"; allobjs.Insert(0, allobj); foreach (Allobj item in allobjs) { if (item.Value == "") { item.Value = item.Obj_Code; } } Isexist_Obj isexist_Obj = new Isexist_Obj(); isexist_Obj.is_exit = is_exit; isexist_Obj.allobj = allobjs; return(isexist_Obj); } catch (Exception e) { throw e; } }