Example #1
0
        /// <summary>
        /// 팝업컨테이터 에티트에서의 키다운
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.KeyEventArgs"/> instance containing the event data.</param>
        private void pop_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.F4)
            {
                return;
            }
            PopupContainerEdit popedit = (PopupContainerEdit)sender;

            Ctl.Control.frmLoading f = new Ctl.Control.frmLoading("검색중 입니다.");

            try
            {
                ///TODO:[가입금등록]팝업컨테이터 에티트에서의 키다운
                string strInput = popedit.EditValue.ToString().Trim();

                f.Show();
                Application.DoEvents();


                //레코드를 가져온다.
                DataTable dtParm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                //회원번호
                if (popedit.Name == "popMemberNo")
                {
                    dtParm.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtParm.Rows.Add(new object[] { "V_MEMBER_NO", strInput });
                    dtParm.Rows.Add(new object[] { "V_FAMILY_SEQ", "" });
                    DataSet ds = DataLayer.ExecuteSpDataset("PKG_COMM.PR_11", dtParm, DataLayer.MessageEncoding.Default);

                    if (ds.Tables[0].Rows.Count <= 0)
                    {
                        this.popMemberNo.EditValue = "입력하세요";
                        this.popMemberNo.SelectAll();
                    }
                    Cls.Common.uPopupContainer.DataBinding(this.popMemberNo, ds.Tables[0]);
                    this.popMemberNo.SelectAll();
                }
            }
            catch (Exception ex)
            {
                if (f.IsHandleCreated)
                {
                    f.Close();
                }
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                if (f.IsHandleCreated)
                {
                    f.Close();
                }
            }
        }
Example #2
0
        /// <summary>
        /// 청구파일제외
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnRegWithOut_Click(object sender, EventArgs e)
        {
            Ctl.Control.frmLoading f = new Ctl.Control.frmLoading("청구내역에서 제외합니다.");

            try
            {
                if (this.gridViewData.RowCount <= 0)
                {
                    return;
                }

                Basic.SetCursor(this, false);

                DataRow[] r = dt.Select("CHK = 'Y'");

                if (r == null || r.Length <= 0)
                {
                    Basic.ShowMessage(1, "선택된 데이터가 없습니다.");
                    return;
                }

                if (Basic.ShowMessageQuestion("선택한 다시 청구 할 수 있습니다. \n\r계속진행 하시겠습니까?") == DialogResult.No)
                {
                    return;
                }

                this.btnRegWithOut.Focus();
                dt.AcceptChanges();

                DataTable[] dtParm = new DataTable[r.Length];


                f.TopMost = true;
                f.Show();
                Application.DoEvents();

                for (int i = 0; i < r.Length; i++)
                {
                    string sale_date = Basic.MaskReplace(r[i]["SALE_DATE"].ToString().Trim());
                    string facility  = r[i]["FACILITY_CODE"].ToString().Trim();
                    string posno     = r[i]["POS_NO"].ToString().Trim();
                    string billno    = r[i]["BILL_NO"].ToString().Trim();
                    string saleyn    = r[i]["SALE_YN"].ToString().Trim();
                    string payseq    = r[i]["PAY_SEQ"].ToString().Trim();



                    dtParm[i] = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                    dtParm[i].TableName = "PKG_JIAAI02.PR_04";

                    dtParm[i].Rows.Add(new object[] { "V_TID", "" });
                    dtParm[i].Rows.Add(new object[] { "V_SALE_DATE", sale_date });
                    dtParm[i].Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtParm[i].Rows.Add(new object[] { "V_FACILITY_CODE", facility });
                    dtParm[i].Rows.Add(new object[] { "V_POS_NO", posno });
                    dtParm[i].Rows.Add(new object[] { "V_BILL_NO", billno });
                    dtParm[i].Rows.Add(new object[] { "V_SALE_YN", saleyn });
                    dtParm[i].Rows.Add(new object[] { "V_PAY_SEQ", payseq });
                    dtParm[i].Rows.Add(new object[] { "V_EMP_NO", Parm.CurrentUserInformation.id });
                    dtParm[i].Rows.Add(new object[] { "V_IP", Parm.CurrentUserInformation.ip });
                }


                DataSet ds = DataLayer.AddProdedcure(dtParm);

                string vRet = DataLayer.ExecuteSpScalaTransaction(ds, "OK", DataLayer.MessageEncoding.Default);

                Basic.SetCursor(this, true);
                if (f.IsHandleCreated)
                {
                    f.Dispose();
                    f.Close();
                }

                if (vRet != "OK")
                {
                    dt.RejectChanges();
                    Basic.ShowMessage(3, vRet);
                    return;
                }
                Basic.ShowMessage(1, "목록을 갱신합니다.");
                fnSelect();
            }
            catch (Exception ex)
            {
                dt.RejectChanges();
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                if (f.IsHandleCreated)
                {
                    f.Dispose();
                    f.Close();
                }
            }
        }
Example #3
0
        /// <summary>
        /// 저장
        /// </summary>
        private void Execute()
        {
            Ctl.Control.frmLoading f = new Ctl.Control.frmLoading("입력 중 입니다..");
            try
            {
                //string season = this.lupSeason.Enabled  ? this.lupSeason.EditValue.ToString().Trim() : "";
                //string useday = this.lupUseDay.Enabled  ? this.lupUseDay.EditValue.ToString().Trim() : "";
                //string week   = this.lupWeek.Enabled    ? this.lupWeek.EditValue.ToString().Trim()   : "";

                string season = this.lupSeason.EditValue.ToString().Trim();
                string useday = this.lupUseDay.EditValue.ToString().Trim();
                string week   = this.lupWeek.EditValue.ToString().Trim();

                if (season == "" && useday == "" && week == "")
                {
                    Basic.ShowMessage(1, "최소 하나의 코드를 선택해야 합니다.");
                    return;
                }


                //인서트한다.

                DataTable[] dtProcedure = new DataTable[dt.Rows.Count];

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string date    = dt.Rows[i]["CALN_DATE"].ToString().Trim().Replace("-", "");
                    string factory = dt.Rows[i]["FACILITY_CODE"].ToString().Trim();

                    dtProcedure[i]           = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtProcedure[i].TableName = "PKG_CAAAI02.PR_04";

                    dtProcedure[i].Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtProcedure[i].Rows.Add(new object[] { "V_CALN_DATE", date });
                    dtProcedure[i].Rows.Add(new object[] { "V_FACTORY", factory });
                    dtProcedure[i].Rows.Add(new object[] { "V_SEASON_CODE", season });
                    dtProcedure[i].Rows.Add(new object[] { "V_USE_DAY_CODE", useday });
                    dtProcedure[i].Rows.Add(new object[] { "V_WEEK_CODE", week });
                    dtProcedure[i].Rows.Add(new object[] { "V_U_EMP_NO", BizCommon.Parm.CurrentUserInformation.id });
                    dtProcedure[i].Rows.Add(new object[] { "V_U_IP", BizCommon.Parm.CurrentUserInformation.ip });
                }


                this.Cursor = Cursors.WaitCursor;
                f.Show();
                Application.DoEvents();

                DataSet ds = DataLayer.AddProdedcure(dtProcedure);
                string  g  = DataLayer.ExecuteSpScalaTransaction(ds, "OK", DataLayer.MessageEncoding.Default);

                if (f.IsHandleCreated)
                {
                    f.Close();
                }
                Application.DoEvents();
                if (g != "OK")
                {
                    Basic.ShowMessage(3, g);
                    return;
                }

                DialogResult = DialogResult.OK;

                Basic.ShowMessage(1, "변경 하였습니다.");
                this.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                this.Cursor = Cursors.Default;
                if (f.IsHandleCreated)
                {
                    f.Close();
                }
                f.Dispose();
                f = null;
            }
        }
Example #4
0
        private void OpenFile(string sFile)
        {
            Ctl.Control.frmLoading f = new Ctl.Control.frmLoading("반환 데이터를 정리중 입니다.");
            try
            {
                // load bitmap from file
                switch (Parm.CurrentUserInformation.BizInfo.BizCode)
                {
                ///천안 휴러클리조트 KICC-EDI-FTP
                case "20":
                    string filename = sFile.Substring(sFile.LastIndexOf('\\') + 1, sFile.Length - sFile.LastIndexOf('\\') - 1);
                    if (filename.Length < 20)
                    {
                        Basic.ShowMessage(2, "EDI 파일형식과 일치하지 않습니다.");
                        return;
                    }
                    else if (filename.Substring(0, 7).ToUpper() != "HURACLE")
                    {
                        Basic.ShowMessage(2, "EDI 파일형식과 일치하지 않습니다.");
                        return;
                    }
                    Basic.SetCursor(this, false);
                    f.Show();
                    Application.DoEvents();
                    PasorEDI(sFile, filename);
                    Basic.SetCursor(this, false);
                    if (f != null && f.IsHandleCreated)
                    {
                        this.Cursor = Cursors.Default;
                        f.Close();
                        f.Dispose();
                        f = null;
                    }
                    break;
                }
                Invalidate();
                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                if (f != null && f.IsHandleCreated)
                {
                    f.Close();
                    f.Dispose();
                    f = null;
                }

                dtMaster.Clear();
                dtDetail.Clear();
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            { this.Cursor = Cursors.Default;
              if (f != null && f.IsHandleCreated)
              {
                  f.Close();
                  f.Dispose();
                  f = null;
              }
            }
        }
Example #5
0
        /// <summary>
        /// 작업일자를 변경한다.
        /// </summary>
        private void fnChange()
        {
            try
            {
                this.btnChangeTaskDate.Enabled = false;
                this.btnInsert.Enabled         = false;
                if (!System.Text.RegularExpressions.Regex.IsMatch(this.txtTaskDateBefor.Text.Trim(), Parm.mMask.DATE))
                {
                    Basic.ShowMessage(1, "날짜를 [YYYY-MM-DD]형식으로 입력하세요");
                    this.txtTaskDateBefor.Focus();
                    return;
                }
                else if (!System.Text.RegularExpressions.Regex.IsMatch(this.txtTaskDateAfter.Text.Trim(), Parm.mMask.DATE))
                {
                    Basic.ShowMessage(1, "날짜를 [YYYY-MM-DD]형식으로 입력하세요");
                    this.txtTaskDateAfter.Focus();
                    return;
                }


                //유효성검사
                if (!IsChekData(false))
                {
                    return;
                }

                //저장
                //담당자체크
                _Pay_UserCheck = "";
                //담당자체크기능 //
                DAHAH05 ff = new DAHAH05(Parm.CurrentUserInformation.roomTask.gsDFacility, "fn_Room_UserCheck");
                ff.Owner = this;
                ff.ShowDialog();

                if (_Pay_UserCheck == "")
                {
                    //Basic.ShowMessage(1, "담당자 확인이 되지 않았습니다.");
                    return;
                }
                string empno = _Pay_UserCheck;
                _Pay_UserCheck = "";

                this.btnInsert.Enabled = false;
                if (f == null)
                {
                    f = new Ctl.Control.frmLoading();
                }
                f.Owner      = this;
                f.SetCaption = "작업일자 변경 중 입니다.";
                f.TopMost    = true;
                f.Show();

                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "변경 중 입니다...", true);

                Application.DoEvents();

                string taskdateAfter = Basic.MaskReplace(txtTaskDateAfter.Text.Trim().Trim());
                string taskdateBefor = Basic.MaskReplace(txtTaskDateBefor.Text.Trim().Trim());

                /************************************
                *         변경프로시져 호출
                ************************************/

                DataTable dtParmChange = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtParmChange.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtParmChange.Rows.Add(new object[] { "V_FACILITY_CODE", Parm.CurrentUserInformation.roomTask.gsDFacility });
                dtParmChange.Rows.Add(new object[] { "V_TASK_DATE", taskdateBefor });
                dtParmChange.Rows.Add(new object[] { "V_NEXT_DATE", taskdateAfter });
                dtParmChange.Rows.Add(new object[] { "V_EMP_NO", empno });
                dtParmChange.Rows.Add(new object[] { "V_IP", Parm.CurrentUserInformation.ip });

                string v_ret = DataLayer.ExecuteSpScala("PKG_DEAAI02.PR_CHANGE_MAIN", dtParmChange, DataLayer.MessageEncoding.Default);

                if (v_ret != "OK")
                {
                    Basic.SetCursor(this, true);
                    Basic.LoadParentFunction(this, "", false);

                    if (f.IsHandleCreated)
                    {
                        f.Close();
                        f.Dispose();
                        f = null;
                    }

                    Basic.ShowMessage(3, v_ret);
                    return;
                }



                if (f.IsHandleCreated)
                {
                    f.Close();
                    f.Dispose();
                    f = null;
                }

                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
                Basic.ShowMessage(1, "영업일자가 변경 되었습니다.");


                ////영업일자를 셋팅한다.
                DataTable dtParm1 = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtParm1.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtParm1.Rows.Add(new object[] { "V_FACILITY_CODE", Parm.CurrentUserInformation.roomTask.gsDFacility });

                string taskdate = "";
                try
                {
                    taskdate = DataLayer.ExecuteSpScala("PKG_DEAAI02.PR_03", dtParm1, DataLayer.MessageEncoding.Default);
                }
                catch (Exception ess)
                {
                    Basic.ShowMessage(1, "마감작업 이후에 작업일자를 가져오지 못했습니다. \r\n전산담당자에게 문의하세요 \n\r" + ess.Message);
                    Application.Exit();
                    return;
                }



                Parm.CurrentUserInformation.roomTask.gsTaskDate = taskdate.Trim();


                //프로그램 하단에 있는 작업일자를 갱신한다.
                //폼을 종료한다.
                Basic.MdiParentFunction(this, "FormClose", new object[] { "PROJECT_D" });
                this.timer_Close.Enabled = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                this.btnChangeTaskDate.Enabled = true;
                this.btnInsert.Enabled         = true;

                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);

                if (f != null && f.IsHandleCreated)
                {
                    f.Close();
                    f.Dispose();
                    f = null;
                }
            }
        }
Example #6
0
        /// <summary>
        /// 일마감작업을 합니다.
        /// </summary>
        private void fnClose()
        {
            try
            {
                this.btnInsert.Enabled         = false;
                this.btnChangeTaskDate.Enabled = false;
                //날씨코드필수입력
                if (!System.Text.RegularExpressions.Regex.IsMatch(this.txtTaskDate.Text.Trim(), Parm.mMask.DATE))
                {
                    Basic.ShowMessage(1, "날짜를 [YYYY-MM-DD]형식으로 입력하세요");
                    this.txtTaskDate.Focus();
                    return;
                }
                else if (lupWeater.EditValue.ToString() == "" || lupWeater.Text.Trim() == "")
                {
                    Basic.ShowMessage(1, "날씨를 선택해 주세요");
                    lupWeater.Focus();
                    return;
                }

                //유효성검사
                if (!IsChekData(true))
                {
                    return;
                }

                //저장
                //담당자체크
                _Pay_UserCheck = "";
                //담당자체크기능 //
                DAHAH05 ff = new DAHAH05(Parm.CurrentUserInformation.roomTask.gsDFacility, "fn_Room_UserCheck");
                ff.Owner = this;

                ff.ShowDialog();

                if (_Pay_UserCheck == "")
                {
                    //Basic.ShowMessage(1, "담당자 확인이 되지 않았습니다.");
                    return;
                }
                string empno = _Pay_UserCheck;
                _Pay_UserCheck = "";
                if (f == null)
                {
                    f = new Ctl.Control.frmLoading();
                }
                f.SetCaption = "객실 마감 중 입니다.";
                f.Owner      = this;
                f.TopMost    = true;
                f.Show();
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "마감 중 입니다.", true);
                Application.DoEvents();

                string taskdate = Basic.MaskReplace(txtTaskDate.Text.Trim());

                /************************************
                *         마감프로시져 호출
                ************************************/
                DataTable dtParmClose = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                dtParmClose.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtParmClose.Rows.Add(new object[] { "V_FACILITY_CODE", Parm.CurrentUserInformation.roomTask.gsDFacility });
                dtParmClose.Rows.Add(new object[] { "V_TASK_DATE", taskdate });
                dtParmClose.Rows.Add(new object[] { "V_EMP_NO", empno });
                dtParmClose.Rows.Add(new object[] { "V_IP", Parm.CurrentUserInformation.ip });

                string v_ret = DataLayer.ExecuteSpScala("PKG_DEAAI02.PR_CLOSE_MAIN", dtParmClose, DataLayer.MessageEncoding.Default);

                if (v_ret != "OK")
                {
                    Basic.SetCursor(this, true);
                    Basic.LoadParentFunction(this, "", false);

                    if (f.IsHandleCreated)
                    {
                        f.Close();
                        f.Dispose();
                        f = null;
                    }
                    Basic.ShowMessage(2, v_ret);
                    return;
                }

                if (f.IsHandleCreated)
                {
                    f.Close();
                    f.Dispose();
                    f = null;
                }

                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
                Basic.ShowMessage(1, "일마감이 완료되었습니다.");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
                this.btnInsert.Enabled         = true;
                this.btnChangeTaskDate.Enabled = true;
                if (f != null && f.IsHandleCreated)
                {
                    f.Close();
                    f.Dispose();
                    f = null;
                }
            }
        }
Example #7
0
        /// <summary>
        /// EDI 파일을 만듭니다.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnMakeFile_Click(object sender, EventArgs e)
        {
            Ctl.Control.frmLoading f = new Ctl.Control.frmLoading("청구확정 작업 중 입니다.");
            try
            {
                if (dt.Rows.Count <= 0)
                {
                    Basic.ShowMessage(1, "청구할 데이터가 없습니다.");
                    return;
                }

                /*************************/
                //    중복승인건 조회
                /*************************/
                DataTable dtParm33 = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                dtParm33.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtParm33.Rows.Add(new object[] { "V_FROM", Basic.MaskReplace(this.dtpFrom.Text.Trim()) });
                dtParm33.Rows.Add(new object[] { "V_TO", Basic.MaskReplace(this.dtpTo.Text.Trim()) });

                DataSet dsTmp = DataLayer.ExecuteSpDataset("PKG_JIAAI09.PR_01", dtParm33, DataLayer.MessageEncoding.Default);
                /*************************/

                if (dsTmp.Tables[0].Rows.Count > 0)
                {
                    JIAAI09 ff = new JIAAI09(dsTmp.Tables[0]);
                    ff.Owner = this;
                    ff.ShowDialog();
                    return;
                    //if(ff.ShowDialog() == DialogResult.No)
                    //{
                    //    return;
                    //}
                    //else
                    //{
                    //    if(Basic.ShowMessageQuestion("승인-취소건을 상계처리 하시겠습니까?") == DialogResult.No) return;
                    //}
                }

                /*가맹점번호 확인*/
                int cntContract = int.Parse(dt.Compute("COUNT(CHK)", "ISNULL(VAN_ID,'') = ''").ToString().Trim());
                if (cntContract > 0)
                {
                    Basic.ShowMessage(2, "가맹점 번호가 없는 데어터가 있습니다.");
                    return;
                }


                int cntCompanyId = int.Parse(dt.Compute("COUNT(CHK)", "ISNULL(COMPANY_ID,'') = ''").ToString().Trim());
                if (cntContract > 0)
                {
                    Basic.ShowMessage(2, "매입사 사업자 번호가 등록되지 않은 데이터가 있습니다.");
                    return;
                }


                Basic.SetCursor(this, false);

                int idate = int.Parse(dt.Compute("COUNT(SALE_AMT)", "LEN(ISNULL(AGREE_DATE,'')) <> 10").ToString());

                if (idate > 0)
                {
                    Basic.ShowMessage(2, "승일일자가 없거나 형식이 틀린 데이터가 있습니다.");
                    return;
                }

                RegistryKey regKey1 = Registry.CurrentUser.CreateSubKey(@"Software\EDIPath");
                string      paths   = "";
                if (regKey1 != null)
                {
                    paths = (string)regKey1.GetValue("Path");
                    regKey1.Close();
                }

                folderBrowserDialog1.SelectedPath = paths;

                EDI.Log.Log.FilePath = "";
                EDI.Log.Log.FileName = "";

                DialogResult dr = this.folderBrowserDialog1.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    EDI.Log.Log.FilePath = this.folderBrowserDialog1.SelectedPath;

                    RegistryKey regKey = Registry.CurrentUser.CreateSubKey(@"Software\EDIPath");
                    regKey.SetValue("DefaultFolder", System.Environment.CurrentDirectory.ToString());
                    regKey.SetValue("Path", EDI.Log.Log.FilePath);
                    regKey.Close();
                }

                if (EDI.Log.Log.FilePath.Trim() == "")
                {
                    return;
                }

                //FileName을 가져온다.
                DataTable dtParm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                dtParm.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtParm.Rows.Add(new object[] { "V_REG_KIND", "I" });

                string vRet = DataLayer.ExecuteSpScala("PKG_JIAAI02.PR_02", dtParm, DataLayer.MessageEncoding.Default);

                string strDate = vRet.Split('|')[0].Trim();
                string strSeq  = vRet.Split('|')[1].Trim();;

                if (int.Parse(strSeq) > 1)
                {
                    Basic.ShowMessage(1, "금일 청구건이 존재합니다. \n\r당일 1회 청구만 가능합니다.");
                    return;
                }


                f.TopMost = true;
                f.Show();
                Application.DoEvents();

                EDI.Log.Log.FileName = GetFileName(strDate, strSeq);

                fnMakeFile();
                SendComplate(strDate, strSeq, EDI.Log.Log.FileName);


                this.dt.Clear();
                this.dtSumery.Clear();
                _strFrom = "";
                _strTo   = "";

                Basic.SetCursor(this, true);
                if (f.IsHandleCreated)
                {
                    f.Dispose();
                    f.Close();
                }

                Application.DoEvents();
                Basic.ShowMessage(1, "파일을 생성하였습니다.");
                Process.Start(EDI.Log.Log.FilePath);
            }
            catch (Exception ex)
            {
                Basic.SetCursor(this, true);
                if (f.IsHandleCreated)
                {
                    f.Dispose();
                    f.Close();
                }

                if (System.IO.File.Exists(Log.FilePath + "\\" + Log.FileName))
                {
                    System.IO.File.Delete(Log.FilePath + "\\" + Log.FileName);
                }

                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                if (f.IsHandleCreated)
                {
                    f.Dispose();
                    f.Close();
                }

                Basic.SetCursor(this, true);
            }
        }
Example #8
0
        /// <summary>
        /// 취소-승인건 자동선택
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnCheck_Click(object sender, EventArgs e)
        {
            Ctl.Control.frmLoading f = new Ctl.Control.frmLoading("승인-취소건을 체크합니다.");

            try
            {
                if (dt.Rows.Count <= 0)
                {
                    Basic.ShowMessage(1, "청구할 데이터가 없습니다.");
                    return;
                }

                if (dt.Rows.Count <= 0)
                {
                    return;
                }

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["CHK"] = "N";
                }


                dt.AcceptChanges();

                DataRow[] r = dt.Select("ISNULL(ORG_AGREE_NO,'') <> '' AND AGREE_YN = 'N' ");

                if (r == null || r.Length <= 0)
                {
                    return;
                }


                /*************************/
                //    중복승인건 조회
                /*************************/
                DataTable dtParm33 = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                dtParm33.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtParm33.Rows.Add(new object[] { "V_FROM", Basic.MaskReplace(this.dtpFrom.Text.Trim()) });
                dtParm33.Rows.Add(new object[] { "V_TO", Basic.MaskReplace(this.dtpTo.Text.Trim()) });

                DataSet dsTmp = DataLayer.ExecuteSpDataset("PKG_JIAAI09.PR_01", dtParm33, DataLayer.MessageEncoding.Default);
                /*************************/

                if (dsTmp.Tables[0].Rows.Count > 0)
                {
                    JIAAI09 ff = new JIAAI09(dsTmp.Tables[0]);
                    ff.Owner = this;
                    ff.ShowDialog();
                    return;
                    //if(ff.ShowDialog() == DialogResult.No)
                    //{
                    //    return;
                    //}
                    //else
                    //{
                    //    if(Basic.ShowMessageQuestion("승인-취소건을 상계처리 하시겠습니까?") == DialogResult.No) return;
                    //}
                }


                Basic.SetCursor(this, false);
                f.TopMost = true;
                f.Show();
                Application.DoEvents();



                this.progressBarControl1.Visible            = true;
                this.progressBarControl1.Properties.Maximum = r.Length;
                this.progressBarControl1.Properties.Minimum = 0;
                this.progressBarControl1.EditValue          = 0;
                for (int j = 0; j < r.Length; j++)
                {
                    Application.DoEvents();
                    this.progressBarControl1.EditValue = j + 1;
                    string saleamt = r[j]["SALE_AMT_ABS"].ToString().Trim();
                    string agreeno = r[j]["AGREE_NO"].ToString().Trim();
                    string cardno  = r[j]["CARD_NO"].ToString().Trim();

                    string filter = "AGREE_NO = '{0}' AND  CARD_NO = '{1}' AND ISNULL(ORG_AGREE_NO,'') = '' AND SALE_AMT_ABS = {2}";

                    filter = string.Format(filter, agreeno, cardno, saleamt);

                    DataRow[] ir = dt.Select(filter);
                    if (ir == null || ir.Length <= 0)
                    {
                        continue;
                    }

                    if (ir.Length > 1)
                    {
                        Basic.SetCursor(this, true);
                        if (f.IsHandleCreated)
                        {
                            f.Dispose();
                            f.Close();
                        }
                        Basic.ShowMessage(1, "중복건이 존재합니다. - " + filter);
                        dt.RejectChanges();
                        return;
                    }

                    ir[0]["CHK"] = "Y";
                    r[j]["CHK"]  = "Y";

                    string sale_date0 = Basic.MaskReplace(r[j]["SALE_DATE"].ToString().Trim());
                    string facility0  = r[j]["FACILITY_CODE"].ToString().Trim();
                    string posno0     = r[j]["POS_NO"].ToString().Trim();
                    string billno0    = r[j]["BILL_NO"].ToString().Trim();
                    string saleyn0    = r[j]["SALE_YN"].ToString().Trim();
                    string payseq0    = r[j]["PAY_SEQ"].ToString().Trim();

                    DataTable[] dtParm = new DataTable[2];

                    dtParm[0] = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                    dtParm[0].TableName = "PKG_JIAAI02.PR_04";

                    dtParm[0].Rows.Add(new object[] { "V_TID", "승인취소-상계" });
                    dtParm[0].Rows.Add(new object[] { "V_SALE_DATE", sale_date0 });
                    dtParm[0].Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtParm[0].Rows.Add(new object[] { "V_FACILITY_CODE", facility0 });
                    dtParm[0].Rows.Add(new object[] { "V_POS_NO", posno0 });
                    dtParm[0].Rows.Add(new object[] { "V_BILL_NO", billno0 });
                    dtParm[0].Rows.Add(new object[] { "V_SALE_YN", saleyn0 });
                    dtParm[0].Rows.Add(new object[] { "V_PAY_SEQ", payseq0 });
                    dtParm[0].Rows.Add(new object[] { "V_EMP_NO", Parm.CurrentUserInformation.id });
                    dtParm[0].Rows.Add(new object[] { "V_IP", Parm.CurrentUserInformation.ip });

                    ///////////////////////////////////////////////////////////////////////////////////////////////////////////

                    string sale_date1 = Basic.MaskReplace(ir[0]["SALE_DATE"].ToString().Trim());
                    string facility1  = ir[0]["FACILITY_CODE"].ToString().Trim();
                    string posno1     = ir[0]["POS_NO"].ToString().Trim();
                    string billno1    = ir[0]["BILL_NO"].ToString().Trim();
                    string saleyn1    = ir[0]["SALE_YN"].ToString().Trim();
                    string payseq1    = ir[0]["PAY_SEQ"].ToString().Trim();



                    dtParm[1] = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                    dtParm[1].TableName = "PKG_JIAAI02.PR_04";

                    dtParm[1].Rows.Add(new object[] { "V_TID", "승인취소-상계" });
                    dtParm[1].Rows.Add(new object[] { "V_SALE_DATE", sale_date1 });
                    dtParm[1].Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtParm[1].Rows.Add(new object[] { "V_FACILITY_CODE", facility1 });
                    dtParm[1].Rows.Add(new object[] { "V_POS_NO", posno1 });
                    dtParm[1].Rows.Add(new object[] { "V_BILL_NO", billno1 });
                    dtParm[1].Rows.Add(new object[] { "V_SALE_YN", saleyn1 });
                    dtParm[1].Rows.Add(new object[] { "V_PAY_SEQ", payseq1 });
                    dtParm[1].Rows.Add(new object[] { "V_EMP_NO", Parm.CurrentUserInformation.id });
                    dtParm[1].Rows.Add(new object[] { "V_IP", Parm.CurrentUserInformation.ip });

                    DataSet ds = DataLayer.AddProdedcure(dtParm);

                    string vRet = DataLayer.ExecuteSpScalaTransaction(ds, "OK", DataLayer.MessageEncoding.Default);

                    if (vRet != "OK")
                    {
                        Basic.ShowMessage(1, vRet + "\n\r" + filter);
                        if (Basic.ShowMessageQuestion("다음건 을 진행하시겠습나까?") == DialogResult.No)
                        {
                            return;
                        }
                    }
                }
                this.progressBarControl1.Visible = false;
                Basic.SetCursor(this, true);
                if (f.IsHandleCreated)
                {
                    f.Dispose();
                    f.Close();
                }
                Basic.ShowMessage(1, "데이터를 갱신합니다.");
                Application.DoEvents();
                InvokeOnClick(btnSelect, new EventArgs());
            }
            catch (Exception ex)
            {
                dt.RejectChanges();
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                this.progressBarControl1.Visible = false;
                Basic.SetCursor(this, true);
                if (f.IsHandleCreated)
                {
                    f.Dispose();
                    f.Close();
                }
            }
        }
Example #9
0
        /// <summary>
        /// 저장
        /// </summary>
        private void Execute()
        {
            Ctl.Control.frmLoading f = new Ctl.Control.frmLoading("입력 중 입니다..");
            try
            {
                //string season = this.lupSeason.Enabled  ? this.lupSeason.EditValue.ToString().Trim() : "";
                //string useday = this.lupUseDay.Enabled  ? this.lupUseDay.EditValue.ToString().Trim() : "";
                //string week   = this.lupWeek.Enabled    ? this.lupWeek.EditValue.ToString().Trim()   : "";

                string confirm = this.lupConfirm.EditValue.ToString().Trim();


                //인서트한다.

                DataTable[] dtProcedure = new DataTable[dt.Rows.Count];

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string eventNo = dt.Rows[i]["EVENT_NO"].ToString().Trim();

                    dtProcedure[i]           = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtProcedure[i].TableName = "PKG_FAAAI02.PR_02";

                    dtProcedure[i].Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtProcedure[i].Rows.Add(new object[] { "V_EVENT_NO", eventNo });
                    dtProcedure[i].Rows.Add(new object[] { "V_CONFIRM", confirm });
                }

                this.Cursor = Cursors.WaitCursor;
                f.Show();
                Application.DoEvents();

                DataSet ds = DataLayer.AddProdedcure(dtProcedure);
                string  g  = DataLayer.ExecuteSpScalaTransaction(ds, "OK", DataLayer.MessageEncoding.Default);

                if (f.IsHandleCreated)
                {
                    f.Close();
                }
                Application.DoEvents();
                if (g != "OK")
                {
                    Basic.ShowMessage(3, g);
                    return;
                }

                DialogResult = DialogResult.OK;

                Basic.ShowMessage(1, "변경 하였습니다.");
                this.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                this.Cursor = Cursors.Default;
                if (f.IsHandleCreated)
                {
                    f.Close();
                }
                f.Dispose();
                f = null;
            }
        }