Exemple #1
0
        private void Get_Push_Notify_Tick(object sender, EventArgs e)
        {
            try
            {
                string sql_Exect = string.Format("Exec sp_Get_Notify @UserName='******'", Form_Main.user.Username);
                string sLink     = Form_Main.URL_API + "/api/IPC247/sp_extension_GetDataByQueryString?str_Query=" + sql_Exect;
                var    json      = API.API_GET_Rep(sLink);

                var       jsondata = JObject.Parse(json).GetValue("Data");
                DataTable dt       = (DataTable)JsonConvert.DeserializeObject(jsondata.ToString(), (typeof(DataTable)));
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string Caption = dt.Rows[i]["Caption"].ToString();
                    string Body    = dt.Rows[i]["Body"].ToString();
                    int    AutoFormDelay;
                    int.TryParse(dt.Rows[i]["AutoFormDelay"].ToString(), out AutoFormDelay);
                    alertControl1.AutoFormDelay = AutoFormDelay;
                    alertControl1.Show(this, Caption, Body, "", Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + "/AppData/Image/switchtimescalesto_32x32.png"), null);
                }
            }
            catch (Exception ex)
            {
                API.API_ERRORLOG(new ERRORLOG(Form_Main.IPAddress, "Form_Main", "Get_Push_Notify_Tick()", ex.ToString()));
            }
        }
Exemple #2
0
 private void LoadInfo_Enquiry()
 {
     try
     {
         string    sLink    = Form_Main.URL_API + "/api/IPC247/sp_extension_GetDataByStore?sql_Exec=" + "sp_getInfo_Enquiry";
         var       json     = API.API_GET_Rep(sLink);
         var       jsondata = JObject.Parse(json).GetValue("Data");
         DataTable dt       = (DataTable)JsonConvert.DeserializeObject(jsondata.ToString(), (typeof(DataTable)));
         dgc_Main.DataSource = dt;
         dgv_Main.BestFitColumns(true);
     }
     catch (Exception ex)
     {
         API.API_ERRORLOG(new ERRORLOG(Form_Main.IPAddress, "Form_EnquiryReport", "LoadInfo_Enquiry()", ex.ToString()));
     }
 }
Exemple #3
0
 private void LoadComboboxStatus()
 {
     try
     {
         string    sLink    = Form_Main.URL_API + "/api/IPC247/sp_extension_GetDataByStore?sql_Exec=" + "sp_LoadMaster_Enquiry";
         var       json     = API.API_GET_Rep(sLink);
         var       jsondata = JObject.Parse(json).GetValue("Data");
         DataTable dt       = (DataTable)JsonConvert.DeserializeObject(jsondata.ToString(), (typeof(DataTable)));
         txtTrangThai.Properties.DataSource = dt;
         txtTrangThai.EditValue             = 0;
     }
     catch (Exception ex)
     {
         API.API_ERRORLOG(new ERRORLOG(Form_Main.IPAddress, "Form_Enquiry", "LoadComboboxStatus()", ex.ToString()));
     }
 }
Exemple #4
0
        private void LoadSoBaoGia()
        {
            try
            {
                string sLink = Form_Main.URL_API + "/api/IPC247/sp_extension_GetDataByStore?sql_Exec=" + "sp_Quote_GenKey";
                var    json  = API.API_GET_Rep(sLink);

                var       jsondata = JObject.Parse(json).GetValue("Data");
                DataTable dt       = (DataTable)JsonConvert.DeserializeObject(jsondata.ToString(), (typeof(DataTable)));
                txtTenBaoGia.Text = dt.Rows[0][0].ToString();
            }
            catch (Exception ex)
            {
                API.API_ERRORLOG(new ERRORLOG(Form_Main.IPAddress, "Form_Quote", "LoadSoBaoGia()", ex.ToString()));
            }
        }
Exemple #5
0
        private void LoadComboboxCompany()
        {
            try
            {
                string sLink = Form_Main.URL_API + "/api/IPC247/sp_extension_GetDataByStore?sql_Exec=" + "sp_GetList_Company";
                var    json  = API.API_GET_Rep(sLink);

                var       jsondata = JObject.Parse(json).GetValue("Data");
                DataTable dt       = (DataTable)JsonConvert.DeserializeObject(jsondata.ToString(), (typeof(DataTable)));
                txtCongTy.Properties.DataSource = dt;
            }
            catch (Exception ex)
            {
                API.API_ERRORLOG(new ERRORLOG(Form_Main.IPAddress, "Form_Customer", "LoadComboboxCompany()", ex.ToString()));
            }
        }
Exemple #6
0
        private void sp_Get_Customer()
        {
            try
            {
                string sql_Exect = string.Format("Exec sp_Get_ListCustomer_Search @Company={0}", chkLayALL.Checked? "0":idCompany);
                string sLink     = Form_Main.URL_API + "/api/IPC247/sp_extension_GetDataByQueryString?str_Query=" + sql_Exect;
                var    json      = API.API_GET_Rep(sLink);

                var       jsondata = JObject.Parse(json).GetValue("Data");
                DataTable dt       = (DataTable)JsonConvert.DeserializeObject(jsondata.ToString(), (typeof(DataTable)));
                txtCustomer.Properties.DataSource = dt;
            }
            catch (Exception ex)
            {
                API.API_ERRORLOG(new ERRORLOG(Form_Main.IPAddress, "Form_Search_Customer", "sp_Get_Customer()", ex.ToString()));
            }
        }
Exemple #7
0
 private void LoadEnquiryDetial(string ID_Enquiry)
 {
     try
     {
         string    sql_Exect = string.Format("Exec sp_GetList_EnquiryDetails @ID_Enquiry={0}", ID_Enquiry);
         string    sLink     = Form_Main.URL_API + "/api/IPC247/sp_extension_GetDataByQueryString?str_Query=" + sql_Exect;
         var       json      = API.API_GET_Rep(sLink);
         var       jsondata  = JObject.Parse(json).GetValue("Data");
         DataTable dt        = (DataTable)JsonConvert.DeserializeObject(jsondata.ToString(), (typeof(DataTable)));
         dgc_Main.DataSource = dt;
         dgv_Main.BestFitColumns(true);
     }
     catch (Exception ex)
     {
         API.API_ERRORLOG(new ERRORLOG(Form_Main.IPAddress, "Form_Enquiry", "LoadEnquiryDetial()", ex.ToString()));
     }
 }
Exemple #8
0
        private void LoadControlProduct()
        {
            try
            {
                string sLink = Form_Main.URL_API + "/api/IPC247/sp_extension_GetDataByStore?sql_Exec=" + "sp_Get_Product";
                var    json  = API.API_GET_Rep(sLink);

                var       jsondata = JObject.Parse(json).GetValue("Data");
                DataTable dt       = (DataTable)JsonConvert.DeserializeObject(jsondata.ToString(), (typeof(DataTable)));
                searchSP.Properties.DataSource = dt;

                LoadSoBaoGia();
            }
            catch (Exception ex)
            {
                API.API_ERRORLOG(new ERRORLOG(Form_Main.IPAddress, "Form_Quote", "LoadControlProduct()", ex.ToString()));
            }
        }
Exemple #9
0
        private void sp_Get_Customer()
        {
            try
            {
                string sql_Exect = string.Format("Exec sp_Get_ListCustomer @Flag ='{0}' ", chkHienThi.Checked ? "1" : "0");
                string sLink     = Form_Main.URL_API + "/api/IPC247/sp_extension_GetDataByQueryString?str_Query=" + sql_Exect;
                var    json      = API.API_GET_Rep(sLink);

                var       jsondata = JObject.Parse(json).GetValue("Data");
                DataTable dt       = (DataTable)JsonConvert.DeserializeObject(jsondata.ToString(), (typeof(DataTable)));
                dgc_Main.DataSource = dt;
                dgv_Main.BestFitColumns(true);
            }
            catch (Exception ex)
            {
                API.API_ERRORLOG(new ERRORLOG(Form_Main.IPAddress, "Form_Customer", "sp_Get_Customer()", ex.ToString()));
            }
        }
Exemple #10
0
        private string GetVersion()
        {
            string version = "";

            try
            {
                string sLink = Form_Main.URL_API + "/api/IPC247/sp_extension_GetDataByStore?sql_Exec=" + "sp_getVersion";
                var    json  = API.API_GET_Rep(sLink);

                var       jsondata = JObject.Parse(json).GetValue("Data");
                DataTable dt       = (DataTable)JsonConvert.DeserializeObject(jsondata.ToString(), (typeof(DataTable)));
                version = dt.Rows[0][0].ToString();
            }
            catch (Exception ex)
            {
                API.API_ERRORLOG(new ERRORLOG(Form_Main.IPAddress, "Form_Main", "GetVersion()", ex.ToString()));
            }
            return(version);
        }