public int loadJobs()
        {
            if (dtJobs!= null && dtJobs.Rows.Count > 0) dtJobs.Clear();

            ClientBaseInfoAdapter adapter = new ClientBaseInfoAdapter();
            dtJobs = adapter.getAllClientBaseInfo(true);

            return dtJobs.Rows.Count;
        }
Beispiel #2
0
        internal int preyAllClientDetailInfo()
        {
            int total = 0;
            ClientBaseInfoAdapter adapter = new ClientBaseInfoAdapter();

            DataTable dt = adapter.getAllClientBaseInfo(true);
            foreach(DataRow row in dt.Rows)
            {
                int uid = (int)row["userId"];
                int pid = (int)row["PhotographerId"];
                string userName = (string)row["userName"];
                string realName = (string)row["realName"];

                int count = 0;
                WebClient wc = getWebClient();
                string trgUrlTmpl = _appSetting.clientDetailUrl;
                string trgUrl = string.Format(trgUrlTmpl, pid, uid);
                string rspData = string.Empty;

                waitRandomTime();
                try
                {
                    rspData = wc.DownloadString(trgUrl);
                    count = parseClientDetailInfo(pid, uid, rspData);
                    Debug.WriteLine("Parse photographer (id={0}) , client = {1},{2}, succ={3}", pid, userName, realName, count);
                }
                catch(WebException wex)
                {
                    Debug.WriteLine("Parse photographer (id={0}) , client = {1},{2}, ERROR={3}", pid, userName, realName, wex.Message);
                    LogHelper.error(string.Format("Parse photographer (id={0}) , client = {1},{2}, ERROR={3}", pid, userName, realName, wex.Message));
                }
                total += count;

            }
            return total;
        }
Beispiel #3
0
 private void saveClientBaseInfo(int userId, string userName, string realName,
     string city, string location, DateTime takeTime, DateTime activateTime, 
     int photoPoint, string status, int ptgphrId)
 {
     ClientBaseInfoAdapter adapter = new ClientBaseInfoAdapter();
     if (adapter.insert(userId, userName, realName, city, location, takeTime, activateTime, photoPoint, status, ptgphrId) == 1)
     {
         Debug.WriteLine(string.Format("[{0}, {1}, {2}]", userId, userName, realName));
     }
 }
Beispiel #4
0
        internal int loadTask()
        {
            _clientIdList.Clear();

            ClientBaseInfoAdapter adapter = new ClientBaseInfoAdapter();
            DataTable dt = adapter.getPendingClients();
            foreach(DataRow row in dt.Rows)
            {
                int cid = (int)row["clientId"];

                _clientIdList.Add(cid);

            }
            return _clientIdList.Count;
        }