Ejemplo n.º 1
0
        public JsonResult getclients()
        {
            List <customclient> list = new List <customclient>();

            try
            {
                string  userid   = Session["UserID"].ToString();
                string  agencyid = Session["AgencyID"].ToString();
                string  roleId   = Session["RoleId"].ToString();
                DataSet ds       = new HomevisitorData().getclients(userid, agencyid, roleId);
                if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows != null && ds.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow item in ds.Tables[0].Rows)
                        {
                            customclient obj = new customclient();
                            obj.clientid   = FingerprintsModel.EncryptDecrypt.Encrypt64(item["ClientID"].ToString());
                            obj.clientname = item["fullname"].ToString();
                            list.Add(obj);
                        }
                    }
                }
                return(Json(new { list }));
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
                return(Json(""));
            }
        }
Ejemplo n.º 2
0
        public JsonResult getclients(int mode = 1)
        {
            List <customclient> list = new List <customclient>();

            try
            {
                DataSet ds = homeVisitorData.getclients(mode);

                if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows != null && ds.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow item in ds.Tables[0].Rows)
                        {
                            customclient obj = new customclient();
                            if (mode == 1)
                            {
                                obj.clientid = FingerprintsModel.EncryptDecrypt.Encrypt64(item["ClientID"].ToString());
                            }
                            else
                            {
                                obj.clientid = item["ClientID"].ToString();
                            }
                            obj.clientname = item["fullname"].ToString();
                            list.Add(obj);
                        }
                    }
                }
                return(Json(new { list }));
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
                return(Json(""));
            }
        }