Beispiel #1
0
        public static bool RequestSplitRepresentative(long sessionId)
        {
            AudioEntity audioEntity = GetParentAudioByIdSession(sessionId);

            if (audioEntity == null)
            {
                return(false);
            }

            RequestSplitRepresentativeParam requestSplitRepresentativeParam = new RequestSplitRepresentativeParam();

            requestSplitRepresentativeParam.idAudio = audioEntity.idAudio;

            try
            {
                string postData   = JsonConvert.SerializeObject(requestSplitRepresentativeParam);
                string postResult = SendPostJsonApplicationTypeRequest(
                    AppsSettings.GetInstance().ApiUrl + "/representativeSplit/loadSplitRepresentative",
                    postData);
                BaseMessage message = JsonConvert.DeserializeObject <BaseMessage>(postResult);
                if (message != null && message.status == Constants.RESPONSE_STATUS_SUCCESS)
                {
                    return(true);
                }
            }catch (Exception e)
            {
                return(false);
            }
            return(false);
        }
Beispiel #2
0
        public static List <GGGUserGroupEntity> GetGGGUserGroupEntities()
        {
            string url = AppsSettings.GetInstance().ApiUrl + String.Format("/role/list");
            Dictionary <string, object> listParameter = new Dictionary <string, object>();

            string result = Request.SendGetRequest(url, listParameter);

            if (result.Equals(""))
            {
                return(null);
            }
            else
            {
                try
                {
                    GGGUserGroupMessage message = JsonConvert.DeserializeObject <GGGUserGroupMessage>(result);
                    if (message != null)
                    {
                        return(message.data);
                    }
                    else
                    {
                        return(null);
                    }
                } catch (Exception e)
                {
                    return(null);
                }
            }
        }
Beispiel #3
0
        public static List <AudioEntity> getListAudio(long sessionId)
        {
            Dictionary <string, object> listParameter = new Dictionary <string, object>();

            string result = SendGetRequest(AppsSettings.GetInstance().ApiUrl + String.Format("/fileAudio/findAudioByIdSession/{0}", sessionId), listParameter);

            if (result.Equals(""))
            {
                return(new List <AudioEntity>());
            }
            else
            {
                try
                {
                    AudioMessages sessionMsg = JsonConvert.DeserializeObject <AudioMessages>(result);
                    if (sessionMsg != null)
                    {
                        return(sessionMsg.data);
                    }
                    else
                    {
                        return(new List <AudioEntity>());
                    }
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e);
                    return(new List <AudioEntity>());
                }
            }
        }
Beispiel #4
0
        public static DocumentEntity getMergedDocument(long sessionId)
        {
            Dictionary <string, object> listParameter = new Dictionary <string, object>();

            string result = SendGetRequest(AppsSettings.GetInstance().ApiUrl + String.Format("/reviewDocx/getMergedFile/{0}", sessionId), listParameter);

            if (result.Equals(""))
            {
                return(new DocumentEntity());
            }
            else
            {
                try
                {
                    DocumentMessage sessionMsg = JsonConvert.DeserializeObject <DocumentMessage>(result);
                    if (sessionMsg != null)
                    {
                        return(sessionMsg.data);
                    }
                    else
                    {
                        return(new DocumentEntity());
                    }
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e);
                    return(new DocumentEntity());
                }
            }
        }
Beispiel #5
0
        public static List <RepresentativeEntity> getListRepresentative(long term)
        {
            Dictionary <string, object> listParameter = new Dictionary <string, object>();

            string result = SendGetRequest(AppsSettings.GetInstance().ApiUrl + String.Format("/representative/national-assembly/{0}", term), listParameter);

            if (result.Equals(""))
            {
                return(new List <RepresentativeEntity>());
            }
            else
            {
                try
                {
                    RepresentativeMessage sessionMsg = JsonConvert.DeserializeObject <RepresentativeMessage>(result);
                    if (sessionMsg != null)
                    {
                        return(sessionMsg.data);
                    }
                    else
                    {
                        return(new List <RepresentativeEntity>());
                    }
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e);
                    return(new List <RepresentativeEntity>());
                }
            }
        }
Beispiel #6
0
        private void Login_To_System()
        {
            // Set cursor as hourglass
            Cursor.Current = Cursors.WaitCursor;
            this.SaveInfo();
            UserInfoMessage userInfo = Request.RequestLogin(this.Login_TB_UserName.Text, this.Login_TB_Password.Text);

            if (userInfo == null)
            {
                ///Return False here
                Debug.WriteLine("Cannot login to system");
                this.LoginForm_LB_Info.Text = "Không thể đăng nhập vào hệ thống.\nKiểm tra lại Tên đăng nhập/Mật khẩu";
            }
            else if (userInfo.roleType == "2")
            {
                Debug.WriteLine("Cannot login to system with this role");
                this.LoginForm_LB_Info.Text = "Không thể đăng nhập vào hệ thống \nbằng quyền người duyệt";
            }
            else
            {
                Debug.WriteLine("Login done");
                this.LoginForm_LB_Info.Text = "";
                AppsSettings.GetInstance().UserInfo = userInfo;
                DialogResult = DialogResult.OK;
            }
            // Set cursor as default arrow
            Cursor.Current = Cursors.Default;
        }
Beispiel #7
0
        private void Btn_Undo_Click(object sender, RibbonControlEventArgs e)
        {
            DialogResult dialogResult = CreateInformationDialog.CreateConfirmBoxWithTwoButton(
                "Bạn có chắc chắn muốn thu hồi phiên họp từ hệ thống 3G?", "Xác nhận");

            if (dialogResult == DialogResult.Yes)
            {
                if (AppsSettings.GetInstance().Session != null)
                {
                    Boolean deleteResult = Request.RemoteGGGSession(AppsSettings.GetInstance().Session.idSession);
                    if (deleteResult == true)
                    {
                        NotificationFactor.InfoNotification("Thu hồi phiên thành công");
                    }
                    else
                    {
                        NotificationFactor.ErrorNotification("Thu hồi phiên thất bại");
                    }
                }
                else
                {
                    NotificationFactor.ErrorNotification("Thu hồi phiên thất bại");
                }
            }
        }
Beispiel #8
0
        public static AudioEntity GetParentAudioByIdSession(long sessionId)
        {
            string url = AppsSettings.GetInstance().ApiUrl + String.Format("/fileAudio/findAudioParrentByIdSession/{0}", sessionId);
            Dictionary <string, object> listParameter = new Dictionary <string, object>();
            string result = Request.SendGetRequest(url, listParameter);

            if (result.Equals(""))
            {
                return(null);
            }
            else
            {
                try
                {
                    AudioParentMessage entity = JsonConvert.DeserializeObject <AudioParentMessage>(result);
                    if (entity != null)
                    {
                        return(entity.data);
                    }
                    else
                    {
                        return(null);
                    }
                } catch (Exception e)
                {
                    return(null);
                }
            }
        }
Beispiel #9
0
        public SettingForm()
        {
            InitializeComponent();

            TB_ApiUrl.Text = AppsSettings.GetInstance().ApiUrl;
            this.ConfigForm_TB_DataPath.Text = AppsSettings.GetInstance().DataDir;
        }
Beispiel #10
0
        public static string SendPostJsonApplicationTypeRequest(string uri, Dictionary <string, Object> parameter)
        {
            try
            {
                // Create a request using a URL that can receive a post.
                WebRequest request = GetWebRequester(uri, AppsSettings.GetInstance().UserInfo.Authorization);
                // Set the Method property of the request to POST.
                request.Method      = "POST";
                request.ContentType = "application/json; charset=UTF-8";

                // Create POST data and convert it to a byte array.
                string postData = "{";// String.Format("{{\"idSession\": {0}, \"status\": 1, \"isLive\": {1} }}", sessionId, isLive);

                foreach (string key in parameter.Keys)
                {
                    string param = string.Format("\"{0}\": {1},", key, parameter[key]);
                    postData = postData + param;
                }
                //Remove last comma
                postData = postData.Substring(0, postData.Length - 1);
                postData = postData + "}";

                byte[] byteArray = Encoding.UTF8.GetBytes(postData);

                // Set the ContentLength property of the WebRequest.
                request.ContentLength = byteArray.Length;

                // Get the request stream.
                Stream dataStream = request.GetRequestStream();
                // Write the data to the request stream.
                dataStream.Write(byteArray, 0, byteArray.Length);
                // Close the Stream object.
                dataStream.Close();

                // Get the response.
                WebResponse response = request.GetResponse();
                // Display the status.
                Console.WriteLine(((HttpWebResponse)response).StatusDescription);

                // Get the stream containing content returned by the server.
                // The using block ensures the stream is automatically closed.
                using (dataStream = response.GetResponseStream())
                {
                    // Open the stream using a StreamReader for easy access.
                    StreamReader reader = new StreamReader(dataStream);
                    // Read the content.
                    string responseFromServer = reader.ReadToEnd();
                    // Display the content.
                    Debug.WriteLine(responseFromServer);
                    response.Close();
                    return(responseFromServer);
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(String.Format("{0}", e));
            }
            return("");
        }
Beispiel #11
0
 public static AppsSettings GetInstance()
 {
     if (mInstance == null)
     {
         mInstance = new AppsSettings();
     }
     return(mInstance);
 }
Beispiel #12
0
        private void BT_Save_Click(object sender, EventArgs e)
        {
            AppsSettings.GetInstance().ApiUrl  = TB_ApiUrl.Text;
            AppsSettings.GetInstance().DataDir = ConfigForm_TB_DataPath.Text;
            AppsSettings.GetInstance().SaveConfigure();

            this.Close();
        }
Beispiel #13
0
        private void btn_ResetAll_Click(object sender, RibbonControlEventArgs e)
        {
            DialogResult dialogResult = CreateInformationDialog.CreateConfirmBoxWithTwoButton("" +
                                                                                              "Tổng hợp lại toàn bộ sẽ xóa toàn bộ thay đổi trên tệp tổng hợp và ghép lại các băng đã được kiểm duyệt. Bạn có muốn tiếp tục?", "Cảnh báo");

            try
            {
                if (dialogResult == DialogResult.Yes && AppsSettings.GetInstance().Session != null)
                {
                    Debug.WriteLine("Xoa toan bo");
                    ///1. Reset merged request

                    bool resetMergedStatus = Request.ResetMergeDocument(AppsSettings.GetInstance().Session.idSession);

                    if (resetMergedStatus == true)
                    {
                        ///Call remerged document
                        //2. Goi ham merge doc
                        AudioEntity entity = Request.GetParentAudioByIdSession(AppsSettings.GetInstance().Session.idSession);
                        if (entity == null)
                        {
                            CreateInformationDialog.CreateWarningBox("Không tồn tại tệp âm thanh tổng hợp", "cảnh báo");
                        }
                        else
                        {
                            Boolean isRequestSuccessful = Request.RequestMerge(entity.idAudio);
                            if (isRequestSuccessful == true)
                            {
                                NotificationFactor.InfoNotification("Tổng hợp biên bản thành công");
                            }
                            else
                            {
                                NotificationFactor.ErrorNotification("Tổng hợp biên bản thất bại");
                            }
                        }
                        //3.Goi ham lay lai du lieu
                        //Get document Entity
                        DocumentEntity documentEntity = Request.getMergedDocument(AppsSettings.GetInstance().Session.idSession);
                        //4.Clear current document
                        AppsSettings.GetInstance().DocumentName = null; // To avoid save document when call the saveAs method
                        Word.Document document = Globals.ThisAddIn.Application.ActiveDocument;
                        WordProcessingHelper.SaveNewSessionDocument(AppsSettings.GetInstance().Session, document);
                        WordProcessingHelper.CreateDocumentTitle(document, AppsSettings.GetInstance().Session);
                        //4. day du lieu ra ma hinh
                        WordProcessingHelper.InsertDataToMergedDocument(Globals.ThisAddIn.Application.ActiveDocument, documentEntity);
                        AppsSettings.GetInstance().IsRepresentativeSplit = false;
                        AppsSettings.GetInstance().DocumentName          = document.FullName;
                    }
                    else
                    {
                        NotificationFactor.ErrorNotification("Không thể tổng hợp lại biên bản");
                    }
                }
            } catch (Exception ex)
            {
                NotificationFactor.ErrorNotification("Không thể tổng hợp lại biên bản");
            }
        }
Beispiel #14
0
        private void SaveDocumentToRemoteServer(bool isNotify = true)
        {
            try
            {
                //1. Luu lai cac thay doi
                ///Kiem tra xem co thay doi nao khoong, neu co, luu lai thay doi
                if (AppsSettings.GetInstance().isLogin == true)
                {
                    Word.Document document = Globals.ThisAddIn.Application.ActiveDocument;

                    /*string missingName;
                     * if (WordProcessingHelper.CheckRepresentativeList(document,
                     *  mRepresentativeForm.GetRepresentativeList(), out missingName) == false)
                     * {
                     *  //Tai lai danh sach
                     *  mRepresentativeForm.FillingData();
                     *  if (WordProcessingHelper.CheckRepresentativeList(document,
                     *  mRepresentativeForm.GetRepresentativeList(), out missingName) == false)
                     *  {
                     *      ///Notify nguoi dung tao moi
                     *      DialogResult result = CreateInformationDialog.CreateConfirmBoxWithTwoButton("Không tìm thấy đại biểu: " + missingName + "  Bạn có muốn thêm mới?", "Cảnh báo");
                     *      if (result == DialogResult.Yes)
                     *      {
                     *          System.Diagnostics.Process.Start(AppsSettings.GetInstance().ApiUrl + "/quan-ly-dai-bieu");
                     *      }
                     *  }
                     * }*/
                    DocumentEntity documentEntity = WordProcessingHelper.ParsingDocument(
                        document, mRepresentativeForm.GetRepresentativeList());
                    documentEntity.sessionId = AppsSettings.GetInstance().Session.idSession;
                    Request.SaveDocument(documentEntity);

                    if (isNotify)
                    {
                        NotificationFactor.InfoNotification("Lưu nội dung thành công");
                    }
                }
                else
                {
                    if (isNotify)
                    {
                        NotificationFactor.WarningNotification("Không thể lưu văn bản do chưa đăng nhập");
                    }
                }
            }
            catch (Exception e)
            {
                if (isNotify)
                {
                    NotificationFactor.ErrorNotification("Lưu nội dung thất bại");
                }
            }

            this.FocusMainDocument();
        }
Beispiel #15
0
 private void Application_DocumentBeforeSave(Word.Document Doc, ref bool SaveAsUI, ref bool Cancel)
 {
     if (AppsSettings.GetInstance().isLogin&&
         AppsSettings.GetInstance().Session != null &&
         AppsSettings.GetInstance().DocumentName != null &&
         Doc.FullName.Equals(AppsSettings.GetInstance().DocumentName))
     {
         Debug.WriteLine(Doc.FullName);
         SaveDocumentToRemoteServer();
     }
 }
Beispiel #16
0
 public static string GetFilePath(string fileName, string ext, string addPath = "")
 {
     if (string.IsNullOrEmpty(addPath))
     {
         return(Path.Combine(AppsSettings.GetInstance().DataDir, fileName + ext));
     }
     else
     {
         return(Path.Combine(AppsSettings.GetInstance().DataDir, addPath, fileName + ext));
     }
 }
Beispiel #17
0
        public static string SendDeleteRequest(string uri, Dictionary <string, Object> parameter)
        {
            try
            {
                if (parameter.Keys.Count > 0)
                {
                    uri = uri + "?";
                }
                foreach (string key in parameter.Keys)
                {
                    string param = string.Format("{0}={1}&", key, parameter[key]);
                    uri = uri + param;
                }
                if (parameter.Keys.Count > 0)
                {
                    uri = uri.Substring(0, uri.Length - 1);
                }
                byte[] byteArray = new byte[0];

                // Create a request using a URL that can receive a post.
                WebRequest request = GetWebRequester(uri, AppsSettings.GetInstance().UserInfo.Authorization);
                // Set the Method property of the request to POST.
                request.Method = "DELETE";
                // Get the response.

                using (WebResponse response = request.GetResponse())
                {
                    // Display the status.
                    Console.WriteLine(((HttpWebResponse)response).StatusDescription);

                    // Get the stream containing content returned by the server.
                    // The using block ensures the stream is automatically closed.
                    using (Stream dataStream = response.GetResponseStream())
                    {
                        // Open the stream using a StreamReader for easy access.
                        StreamReader reader = new StreamReader(dataStream);
                        // Read the content.
                        string responseFromServer = reader.ReadToEnd();
                        // Display the content.
                        Debug.WriteLine(responseFromServer);
                        response.Close();
                        return(responseFromServer);
                    }
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(String.Format("{0}", e));
            }
            return("");
        }
Beispiel #18
0
 private void Application_WindowActivate(Word.Document Doc, Word.Window Wn)
 {
     Debug.WriteLine("Windown Active on this: " + Doc.FullName + "  " +
                     Doc.FullName.Equals(AppsSettings.GetInstance().DocumentName));
     if (AppsSettings.GetInstance().isLogin&&
         AppsSettings.GetInstance().Session != null &&
         AppsSettings.GetInstance().DocumentName != null &&
         Doc.FullName.Equals(AppsSettings.GetInstance().DocumentName))
     {
         ActiveControl();
     }
     else
     {
         DeactiveControl();
     }
 }
Beispiel #19
0
        public static string SendPostJsonApplicationTypeRequest(string uri, string postData)
        {
            try
            {
                // Create a request using a URL that can receive a post.
                WebRequest request = GetWebRequester(uri, AppsSettings.GetInstance().UserInfo.Authorization);
                // Set the Method property of the request to POST.
                request.Method      = "POST";
                request.ContentType = "application/json; charset=UTF-8";

                byte[] byteArray = Encoding.UTF8.GetBytes(postData);

                // Set the ContentLength property of the WebRequest.
                request.ContentLength = byteArray.Length;

                // Get the request stream.
                Stream dataStream = request.GetRequestStream();
                // Write the data to the request stream.
                dataStream.Write(byteArray, 0, byteArray.Length);
                // Close the Stream object.
                dataStream.Close();

                // Get the response.
                WebResponse response = request.GetResponse();
                // Display the status.
                Console.WriteLine(((HttpWebResponse)response).StatusDescription);

                // Get the stream containing content returned by the server.
                // The using block ensures the stream is automatically closed.
                using (dataStream = response.GetResponseStream())
                {
                    // Open the stream using a StreamReader for easy access.
                    StreamReader reader = new StreamReader(dataStream);
                    // Read the content.
                    string responseFromServer = reader.ReadToEnd();
                    // Display the content.
                    Debug.WriteLine(responseFromServer);
                    response.Close();
                    return(responseFromServer);
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(String.Format("{0}", e));
            }
            return("");
        }
Beispiel #20
0
        private void On_Btn_Login(object sender, RibbonControlEventArgs e)
        {
            DialogResult result = DialogResult.OK;

            result = mLoginForm.ShowDialog();
            if (result == DialogResult.OK)
            {
                ///Create the Default document
                Aplication_CreateDefault();

                AppsSettings.GetInstance().isLogin = true;
                Btn_ListSession.Enabled = true;

                ///Create form
                mSessionListForm    = new SessionList();
                mRepresentativeForm = new RepresentativeForm();
            }
        }
Beispiel #21
0
        private void Btn_ListSession_Click(object sender, RibbonControlEventArgs e)
        {
            if (AppsSettings.GetInstance().isLogin == false)
            {
                MessageBox.Show("Bạn phải đăng nhập trước khi sử dụng", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (AppsSettings.GetInstance().Session != null)
                {
                    DialogResult dialogResult = CreateInformationDialog.CreateConfirmBoxWithTwoButton(
                        "Bạn đang mở phiên họp. Bạn có muốn lưu lại nội dung phiên họp hiện tại không?",
                        "Cảnh bảo");
                    if (dialogResult == DialogResult.Yes)
                    {
                        SaveDocumentToRemoteServer(false);
                    }
                }

                DialogResult result = DialogResult.OK;
                result = this.mSessionListForm.CustomDialogShow();
                if (result == DialogResult.OK)
                {
                    ///Create new document and save as new file
                    Word.Document document = Globals.ThisAddIn.Application.ActiveDocument;
                    AppsSettings.GetInstance().DocumentName = null; //To prevent save unknow document
                    WordProcessingHelper.SaveNewSessionDocument(AppsSettings.GetInstance().Session, document);
                    ///Create default document
                    WordProcessingHelper.CreateDocumentTitle(document,
                                                             AppsSettings.GetInstance().Session);
                    AppsSettings.GetInstance().DocumentName = document.FullName;
                    //Get document Entity
                    DocumentEntity documentEntity = Request.getMergedDocument(AppsSettings.GetInstance().Session.idSession);
                    WordProcessingHelper.InsertDataToMergedDocument(document, documentEntity);
                    ///Load predefine data
                    mRepresentativeForm.FillingData();
                    AppsSettings.GetInstance().IsRepresentativeSplit = false;
                    this.FocusMainDocument();
                    this.ActiveControl();
                }
            }
        }
Beispiel #22
0
        public static bool ResetMergeDocument(long sessionId)
        {
            string url = AppsSettings.GetInstance().ApiUrl + String.Format("/reviewDocx/resetMergeFile/{0}", sessionId);
            Dictionary <string, object> listParameter = new Dictionary <string, object>();
            string postResult = SendGetRequest(url, listParameter);

            try
            {
                BaseMessage message = JsonConvert.DeserializeObject <BaseMessage>(postResult);
                if (message != null && message.status == Constants.RESPONSE_STATUS_SUCCESS)
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                return(false);
            }
            return(false);
        }
Beispiel #23
0
        private void Btn_Spit_Click(object sender, RibbonControlEventArgs e)
        {
            try
            {
                Word.Document document = Globals.ThisAddIn.Application.ActiveDocument;
                string        missingName;
                if (WordProcessingHelper.CheckRepresentativeList(document,
                                                                 mRepresentativeForm.GetRepresentativeList(), out missingName) == false)
                {
                    //Tai lai danh sach
                    mRepresentativeForm.FillingData();
                    if (WordProcessingHelper.CheckRepresentativeList(document,
                                                                     mRepresentativeForm.GetRepresentativeList(), out missingName) == false)
                    {
                        ///Notify nguoi dung tao moi
                        DialogResult result = CreateInformationDialog.CreateConfirmBoxWithTwoButton("Không tìm thấy đại biểu: " + missingName + "  Bạn có muốn thêm mới?", "Cảnh báo");
                        if (result == DialogResult.Yes)
                        {
                            System.Diagnostics.Process.Start(AppsSettings.GetInstance().ApiUrl + "/quan-ly-dai-bieu");
                        }
                        return;
                    }
                }
                DocumentEntity documentEntity = WordProcessingHelper.ParsingDocument(
                    document, mRepresentativeForm.GetRepresentativeList());

                ///Save document to server
                documentEntity.sessionId = AppsSettings.GetInstance().Session.idSession;
                Request.SaveDocument(documentEntity);

                ///Call API to split representative
                Request.RequestSplitRepresentative(AppsSettings.GetInstance().Session.idSession);

                mRepresentativeSplitForm.InitDataFormIntoForm(documentEntity);
                mRepresentativeSplitForm.ShowDialog();
                AppsSettings.GetInstance().IsRepresentativeSplit = true;
            } catch (Exception ee)
            {
                NotificationFactor.ErrorNotification("Không thể tách lời đại biểu");
            }
        }
Beispiel #24
0
        public static bool SaveDocument(DocumentEntity documentEntity)
        {
            string postData   = JsonConvert.SerializeObject(documentEntity);
            string postResult = SendPostJsonApplicationTypeRequest(
                AppsSettings.GetInstance().ApiUrl + "/reviewDocx/saveMergedFile",
                postData);

            try
            {
                BaseMessage message = JsonConvert.DeserializeObject <BaseMessage>(postResult);
                if (message != null && message.status == Constants.RESPONSE_STATUS_SUCCESS)
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                return(false);
            }
            return(false);
        }
Beispiel #25
0
        public static bool ExportSessionToGGGSystem(GGGExportEntity gGGExportEntity)
        {
            string url = AppsSettings.GetInstance().ApiUrl + String.Format("/sessions/exportToRemoteServer");
            Dictionary <string, object> listParameter = new Dictionary <string, object>();

            string postData   = JsonConvert.SerializeObject(gGGExportEntity);
            string postResult = SendPostJsonApplicationTypeRequest(url, postData);

            try
            {
                BaseMessage message = JsonConvert.DeserializeObject <BaseMessage>(postResult);
                if (message != null && message.status == Constants.RESPONSE_STATUS_SUCCESS)
                {
                    return(true);
                }
            } catch (Exception e)
            {
                return(false);
            }
            return(false);
        }
Beispiel #26
0
        public static List <SessionsEntity> getListSession(long numberRecords)
        {
            Dictionary <string, object> listParameter = new Dictionary <string, object>();

            //meetingEntity
            listParameter.Add("meetingEntity", "");
            //activity
            listParameter.Add("activity", "");
            //meetingDay
            listParameter.Add("meetingDay", "");
            //page
            listParameter.Add("page", "1");
            //size
            listParameter.Add("size", String.Format("{0}", numberRecords));

            string result = SendGetRequest(AppsSettings.GetInstance().ApiUrl + "/sessions/findByUserPermit", listParameter);

            if (result.Equals(""))
            {
                return(new List <SessionsEntity>());
            }
            else
            {
                try
                {
                    SessionMessage sessionMsg = JsonConvert.DeserializeObject <SessionMessage>(result);
                    if (sessionMsg != null)
                    {
                        return(sessionMsg.data.listSession);
                    }
                    else
                    {
                        return(new List <SessionsEntity>());
                    }
                } catch (Exception e) {
                    Debug.WriteLine(e);
                    return(new List <SessionsEntity>());
                }
            }
        }
Beispiel #27
0
        public static bool RequestMerge(long idAudioParent)
        {
            string url = AppsSettings.GetInstance().ApiUrl + "/reviewDocx/mergeFile";
            Dictionary <string, object> listParameter = new Dictionary <string, object>();

            listParameter.Add("idAudioParent", idAudioParent);

            string result = SendPostJsonApplicationTypeRequest(url, listParameter);

            try
            {
                BaseMessage message = JsonConvert.DeserializeObject <BaseMessage>(result);
                if (message != null && message.status == Constants.RESPONSE_STATUS_SUCCESS)
                {
                    return(true);
                }
            } catch (Exception e)
            {
                return(false);
            }
            return(false);
        }
Beispiel #28
0
        private void Btn_Export_Click(object sender, RibbonControlEventArgs e)
        {
            if (AppsSettings.GetInstance().IsRepresentativeSplit == true)
            {
                mExportForm.LoadingData();
                DialogResult dialogResult = mExportForm.ShowDialog();

                if (dialogResult == DialogResult.OK)
                {
                    NotificationFactor.InfoNotification("Xuất bản thành công");
                }
                else if (dialogResult == DialogResult.No)
                {
                    NotificationFactor.ErrorNotification("Xuất bản thất bại");
                }
            }
            else
            {
                CreateInformationDialog.CreateWarningBox("Bạn chưa tách lời đại biểu. Tách lời đại biểu trước khi xuất bản.",
                                                         "cảnh báo");
            }
        }
Beispiel #29
0
 public static string ParsingApiUrl()
 {
     return(AppsSettings.GetInstance().ApiUrl);
 }
Beispiel #30
0
 private void Btn_SessionInfo_Click(object sender, RibbonControlEventArgs e)
 {
     using (var sessionInfo = new SessionInformationForm(AppsSettings.GetInstance().Session))
         sessionInfo.ShowDialog();
 }