예제 #1
0
 public IHttpActionResult GetPersonel(object obj)
 {
     try
     {
         JObject            JsonObject  = JObject.Parse(obj.ToString());
         Bis.PersonelMethod BisPersonel = new Bis.PersonelMethod();
         ViewModel.Search   get         = new ViewModel.Search();
         get.Filter     = " And tblPersonel.IDUser = '******' ";
         get.JsonResult = " FOR JSON PATH";
         JArray JsonPersonel = BisPersonel.GetPersoneJsonlData(get);
         return(Ok(JsonPersonel));
     }
     catch
     {
         return(NotFound());
     }
 }
예제 #2
0
        public List <string> getPersonel(string prefix)
        {
            Bis.PersonelMethod bisPersonel    = new Bis.PersonelMethod();
            ViewModel.Search   searchPersonel = new ViewModel.Search();
            searchPersonel.Filter = " and tblPersonel.FName +' '+ tblPersonel.LName like N'%" + prefix.FixFarsi() + "%' and Active='true'";
            //searchCompany.Order = "order by tblLegalUser.Name_Fa desc";
            DataSet dsPersonel = bisPersonel.GetPersonelData(searchPersonel);

            List <string> PersonelNames = new List <string>();

            if (!dsPersonel.Null_Ds())
            {
                for (int i = 0; i < dsPersonel.Tables[0].Rows.Count; i++)
                {
                    PersonelNames.Add(string.Format("{0}~{1}", dsPersonel.Tables[0].Rows[i]["FullName"].ToString(), dsPersonel.Tables[0].Rows[i]["IDUser"].ToString()));
                }
                return(PersonelNames);
            }
            else
            {
                PersonelNames.Add(string.Format("{0}~{1}", "اطلاعاتی یافت نشد", Guid.Empty));
                return(PersonelNames);
            }
        }