public static void AsyncPOST(string MeetingID, string UserID, string DeptId, string FilePath, Action <SigninDataUpload> DoAction, Action ErrorAction = null) { _003C_003Ec__DisplayClass2 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass2(); _003C_003Ec__DisplayClass.DoAction = DoAction; _003C_003Ec__DisplayClass.ErrorAction = ErrorAction; string url = WsTool.GetUrl(); string format = "<?xml version=\"1.0\"?><UserInfo><MeetingID>{0}</MeetingID><UserID><![CDATA[{1}]]></UserID><DeptId><![CDATA[{2}]]></DeptId></UserInfo>"; format = string.Format(format, MeetingID, UserID, DeptId); UploadFile uploadFile = new UploadFile(); FileInfo fileInfo = new FileInfo(FilePath); uploadFile.Name = fileInfo.Name.Split('.')[0]; uploadFile.Filename = fileInfo.Name; uploadFile.ContentType = "image/png"; uploadFile.Stream = File.Open(FilePath, FileMode.Open); NameValueCollection nameValueCollection = new NameValueCollection(); nameValueCollection.Add("XmlDoc", format); NameValueCollection values = nameValueCollection; UploadFile[] files = new UploadFile[1] { uploadFile }; HttpWebRequest httpWebRequestWithFile = HttpTool.GetHttpWebRequestWithFile(url + "/SigninDataUpload", files, values); HttpTool.DoWithResponse(httpWebRequestWithFile, new Action <HttpWebResponse>(_003C_003Ec__DisplayClass._003CAsyncPOST_003Eb__1)); }
public static void AsyncPOST(string UserID, string PinCode, Action <string> DoAction, Action ErrorAction = null) { Action <HttpWebResponse> action = null; _003C_003Ec__DisplayClass2 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass2(); _003C_003Ec__DisplayClass.DoAction = DoAction; _003C_003Ec__DisplayClass.ErrorAction = ErrorAction; try { string url = WsTool.GetUrl(); string format = "<?xml version=\"1.0\"?><UserInfo><UserID><![CDATA[{0}]]></UserID><PinCode>{1}</PinCode></UserInfo>"; format = string.Format(format, UserID, PinCode); Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary["XmlDoc"] = format; HttpWebRequest httpWebRequest = HttpTool.GetHttpWebRequest(url + "/NewMeeting", "POST", dictionary); if (action == null) { action = new Action <HttpWebResponse>(_003C_003Ec__DisplayClass._003CAsyncPOST_003Eb__0); } HttpTool.DoWithResponse(httpWebRequest, action); } catch (Exception ex) { LogTool.Debug(ex); } }
public static void AsyncPOST(string MeetingID, string AttachID, string Email, string Text, string FilePath, Action <AnnotationUpload> DoAction, Action ErrorAction = null) { _003C_003Ec__DisplayClass2 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass2(); _003C_003Ec__DisplayClass.DoAction = DoAction; _003C_003Ec__DisplayClass.ErrorAction = ErrorAction; string url = WsTool.GetUrl(); string format = "<?xml version=\"1.0\"?><UserInfo><MeetingID>{0}</MeetingID><AttachID>{1}</AttachID><Email>{2}</Email><Text>{3}</Text></UserInfo>"; format = string.Format(format, MeetingID, AttachID, Email, Text); UploadFile uploadFile = new UploadFile(); FileInfo fileInfo = new FileInfo(FilePath); uploadFile.Name = fileInfo.Name.Split('.')[0]; uploadFile.Filename = fileInfo.Name; uploadFile.ContentType = "image/jpg"; uploadFile.Stream = File.Open(FilePath, FileMode.Open); NameValueCollection nameValueCollection = new NameValueCollection(); nameValueCollection.Add("XmlDoc", format); NameValueCollection values = nameValueCollection; UploadFile[] files = new UploadFile[1] { uploadFile }; HttpWebRequest httpWebRequestWithFile = HttpTool.GetHttpWebRequestWithFile(url + "/AnnotationUpload", files, values); HttpTool.DoWithResponse(httpWebRequestWithFile, new Action <HttpWebResponse>(_003C_003Ec__DisplayClass._003CAsyncPOST_003Eb__1)); }
public static void AsyncPOST(Action <LawData> DoAction, Action ErrorAction = null) { _003C_003Ec__DisplayClass1 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass1(); _003C_003Ec__DisplayClass.DoAction = DoAction; _003C_003Ec__DisplayClass.ErrorAction = ErrorAction; string url = WsTool.GetUrl(); HttpWebRequest httpWebRequest = HttpTool.GetHttpWebRequest(url + "/LawData", "POST"); HttpTool.DoWithResponse(httpWebRequest, new Action <HttpWebResponse>(_003C_003Ec__DisplayClass._003CAsyncPOST_003Eb__0)); }
public static void AsyncPOST(string meetingID, Action <SigninData> DoAction, Action ErrorAction = null) { _003C_003Ec__DisplayClass1 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass1(); _003C_003Ec__DisplayClass.DoAction = DoAction; _003C_003Ec__DisplayClass.ErrorAction = ErrorAction; string url = WsTool.GetUrl(); string format = "<?xml version=\"1.0\"?><UserInfo><MeetingID>{0}</MeetingID></UserInfo>"; format = string.Format(format, meetingID); Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary["XmlDoc"] = format; HttpWebRequest httpWebRequest = HttpTool.GetHttpWebRequest(url + "/SigninData", "POST", dictionary); HttpTool.DoWithResponse(httpWebRequest, new Action <HttpWebResponse>(_003C_003Ec__DisplayClass._003CAsyncPOST_003Eb__0)); }
public static void AsyncPOST(string MeetingID, string UserID, string AgendaID, string AgendaStatus, Action <bool> DoAction, Action ErrorAction = null) { _003C_003Ec__DisplayClass1 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass1(); _003C_003Ec__DisplayClass.DoAction = DoAction; _003C_003Ec__DisplayClass.ErrorAction = ErrorAction; string url = WsTool.GetUrl(); string format = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><UserInfo><MeetingID>{0}</MeetingID><UserID><![CDATA[{1}]]></UserID><UpdateList><UpdateAgenda><AgendaID>{2}</AgendaID><AgendaStatus>{3}</AgendaStatus></UpdateAgenda></UpdateList></UserInfo>"; format = string.Format(format, MeetingID, UserID, AgendaID, AgendaStatus); Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary["XmlDoc"] = format; HttpWebRequest httpWebRequest = HttpTool.GetHttpWebRequest(url + "/ProgressUpload", "POST", dictionary); HttpTool.DoWithResponse(httpWebRequest, new Action <HttpWebResponse>(_003C_003Ec__DisplayClass._003CAsyncPOST_003Eb__0)); }
public static void AsyncPOST(string UserID, string UserPWD, DateTime date, Action <User, DateTime> DoAction, Action ErrorAction = null) { Action <HttpWebResponse> action = null; Action action2 = null; _003C_003Ec__DisplayClass4 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass4(); _003C_003Ec__DisplayClass.date = date; _003C_003Ec__DisplayClass.DoAction = DoAction; _003C_003Ec__DisplayClass.ErrorAction = ErrorAction; try { string url = WsTool.GetUrl(); string format = "<?xml version=\"1.0\"?><UserInfo><UserID><![CDATA[{0}]]></UserID><UserPW><![CDATA[{1}]]></UserPW><UserDevice>1</UserDevice><UserDateBegin>{2}</UserDateBegin><UserDateEnd>{3}</UserDateEnd></UserInfo>"; format = string.Format(format, UserID, UserPWD, DateTool.MonthFirstDate(_003C_003Ec__DisplayClass.date).ToString("yyyyMMdd"), DateTool.MonthLastDate(_003C_003Ec__DisplayClass.date).ToString("yyyyMMdd")); Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary["XmlDoc"] = format; HttpWebRequest httpWebRequest = HttpTool.GetHttpWebRequest(url + "/UserData", "POST", dictionary); if (action == null) { action = new Action <HttpWebResponse>(_003C_003Ec__DisplayClass._003CAsyncPOST_003Eb__0); } Action <HttpWebResponse> responseAction = action; if (action2 == null) { action2 = new Action(_003C_003Ec__DisplayClass._003CAsyncPOST_003Eb__1); } HttpTool.DoWithResponse(httpWebRequest, responseAction, action2); } catch (Exception ex) { if (_003C_003Ec__DisplayClass.ErrorAction != null) { _003C_003Ec__DisplayClass.ErrorAction(); } AutoClosingMessageBox.Show(ex.Message); LogTool.Debug(ex); } }
public static void AsyncPOST(string MeetingID, string UserID, string UserPWD, Action <MeetingData> DoAction, Action ErrorAction = null) { Action <HttpWebResponse> action = null; Action action2 = null; _003C_003Ec__DisplayClass4 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass4(); _003C_003Ec__DisplayClass.DoAction = DoAction; _003C_003Ec__DisplayClass.ErrorAction = ErrorAction; try { string url = WsTool.GetUrl(); string format = "<?xml version=\"1.0\"?><UserInfo><MeetingID>{0}</MeetingID><UserID><![CDATA[{1}]]></UserID><UserPW><![CDATA[{2}]]></UserPW></UserInfo>"; format = string.Format(format, MeetingID, UserID, UserPWD); Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary["XmlDoc"] = format; HttpWebRequest httpWebRequest = HttpTool.GetHttpWebRequest(url + "/MeetingData", "POST", dictionary); if (action == null) { action = new Action <HttpWebResponse>(_003C_003Ec__DisplayClass._003CAsyncPOST_003Eb__0); } Action <HttpWebResponse> responseAction = action; if (action2 == null) { action2 = new Action(_003C_003Ec__DisplayClass._003CAsyncPOST_003Eb__1); } HttpTool.DoWithResponse(httpWebRequest, responseAction, action2); } catch (Exception ex) { if (_003C_003Ec__DisplayClass.ErrorAction != null) { _003C_003Ec__DisplayClass.ErrorAction(); } AutoClosingMessageBox.Show(ex.Message); LogTool.Debug(ex); } }