Beispiel #1
0
        public void CLEAR()
        {
            int nRow = GRD_LOG.RowCount;

            for (int i = nRow - 1; i >= 0; i--)
            {
                GRD_LOG.Rows.RemoveAt(i);
            }

            GRD_LOG.Refresh();
        }
Beispiel #2
0
        private void BTN_SEARCH_Click(object sender, EventArgs e)
        {
            if (!BTN_SEARCH.Enabled)
            {
                return;
            }
            int nRow = GRD_LOG.RowCount;

            for (int i = nRow - 1; i >= 0; i--)
            {
                GRD_LOG.Rows.RemoveAt(i);
            }
            GRD_LOG.Refresh();
            BTN_SEARCH.Enabled = false;

            JObject jsonReq = new JObject();

            try
            {
                setWaitCursor(true);

                Constants.LOGGER_MAIN.Info("txt_StartDate.Value : " + txt_StartDate.Value);
                Constants.LOGGER_MAIN.Info("txt_EndDate.Value : " + txt_EndDate.Value);

                int diff = DateTime.Compare(txt_StartDate.Value, txt_EndDate.Value);
                Constants.LOGGER_MAIN.Info("diff : " + diff);

                TimeSpan between_date = txt_EndDate.Value - txt_StartDate.Value;
                int      date_cnt     = between_date.Days;
                Constants.LOGGER_MAIN.Info("date_cnt : " + date_cnt);
                if (diff > 0)
                {
                    // 미래날짜의 경우
                    MessageBox.Show(Constants.CONF_MANAGER.getCustomValue("Message", Constants.SYSTEM_LANGUAGE + "/ValidateSearchDate"));
                    return;
                }
                else if (date_cnt > 7)
                {
                    // 일주일 이상의 경우
                    MessageBox.Show(Constants.CONF_MANAGER.getCustomValue("Message", Constants.SYSTEM_LANGUAGE + "/ExceedSearchDate"));
                    return;
                }
                jsonReq.Add("group_id", Constants.GROUP_ID);
                jsonReq.Add("date_div", "P");
                jsonReq.Add("start_date", Util.Utils.FormatConvertDate(txt_StartDate.Text));
                jsonReq.Add("end_date", Util.Utils.FormatConvertDate(txt_EndDate.Text));
                jsonReq.Add("shop_id", Constants.MID);
                //jsonReq.Add("date", Util.Utils.FormatConvertDate(txt_EndDate.Text));

                //if (!txt_InvoiceNo.Equals(""))
                //{
                //jsonReq.Add("seal_bag_no", txt_InvoiceNo.Text);
                //jsonReq.Add("seal_bag_no", "");
                //}

                Transaction tran = new Transaction();

                string page      = "1";
                int    total_cnt = tran.searchLogBookCount(jsonReq.ToString());
                if (total_cnt > 0)
                {
                    if (cmbbox_Page.Items.Count > 0)
                    {
                        cmbbox_Page.Items.Clear();
                    }

                    int    i         = 0;
                    double quotient  = total_cnt / display_num;
                    double remainder = total_cnt % display_num;

                    double tot_page = 0;
                    if (remainder != 0)
                    {
                        tot_page = System.Math.Truncate(quotient);
                    }
                    else
                    {
                        tot_page = System.Math.Truncate(quotient) - 1;
                    }

                    for (i = 0; i <= tot_page; i++)
                    {
                        cmbbox_Page.Items.Add(i + 1);
                    }

                    searchList(page);
                }
                else
                {
                    MetroMessageBox.Show(this, Constants.CONF_MANAGER.getCustomValue("Message", Constants.SYSTEM_LANGUAGE + "/DataNotFound"),
                                         "Search", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }
            finally
            {
                setWaitCursor(false);
                BTN_SEARCH.Enabled = true;
            }
        }
Beispiel #3
0
        private void COM_STORE_SelectedIndexChanged(object sender, EventArgs e)
        {
            int nRow = GRD_LOG.RowCount;

            for (int i = nRow - 1; i >= 0; i--)
            {
                GRD_LOG.Rows.RemoveAt(i);
            }
            GRD_LOG.Refresh();

            if (COM_STORE.SelectedIndex == 0)
            {
                BTN_SEARCH.Enabled = false;
                BTN_EXCEL.Enabled  = false;
                BTN_PRINT.Enabled  = false;
            }
            else
            {
                BTN_SEARCH.Enabled = true;
                BTN_EXCEL.Enabled  = true;
                BTN_PRINT.Enabled  = true;
                JObject jsonStore = Constants.merchant_list[(COM_STORE.SelectedIndex - 1)].ToObject <JObject>();
                if (jsonStore["mid"] != null)
                {
                    Constants.MID = jsonStore["mid"].ToString();
                }
                if (jsonStore["tid"] != null)
                {
                    Constants.TID = jsonStore["tid"].ToString();
                }
                if (jsonStore["gst_no"] != null)
                {
                    Constants.GST_NO = jsonStore["gst_no"].ToString();
                }
                if (jsonStore["rec_prefix"] != null)
                {
                    Constants.REC_PREFIX = jsonStore["rec_prefix"].ToString();
                }
                if (jsonStore["dup_rc"] != null)
                {
                    Constants.DUP_RC = jsonStore["dup_rc"].ToString();
                }
                if (jsonStore["rec_digits"] != null)
                {
                    Constants.REC_DIGITS = jsonStore["rec_digits"].ToString();
                }
                if (jsonStore["item_code1"] != null)
                {
                    Constants.ITEM_CODE1 = jsonStore["item_code1"].ToString();
                }
                if (jsonStore["item_code2"] != null)
                {
                    Constants.ITEM_CODE2 = jsonStore["item_code2"].ToString();
                }
                if (jsonStore["item_code3"] != null)
                {
                    Constants.ITEM_CODE3 = jsonStore["item_code3"].ToString();
                }
                if (jsonStore["item_code4"] != null)
                {
                    Constants.ITEM_CODE4 = jsonStore["item_code4"].ToString();
                }
                if (jsonStore["item_code5"] != null)
                {
                    Constants.ITEM_CODE5 = jsonStore["item_code5"].ToString();
                }
            }
        }