Beispiel #1
0
        private void SetCompInfo(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1 && e.ColumnIndex > -1)
            {
                DataGridView view = (DataGridView)sender;
                DataRow      row  = _dtComp.Rows[e.RowIndex];

                if ("FILE1".Equals(view.Columns[e.ColumnIndex].Name))
                {
                    if (!"".Equals(row["FILE_1"].ToString()))
                    {
                        FileGet file = new FileGet(row["FILE_1"].ToString());
                        file.Close();
                    }
                }
                else if ("FILE2".Equals(view.Columns[e.ColumnIndex].Name))
                {
                    if (!"".Equals(row["FILE_2"].ToString()))
                    {
                        FileGet file = new FileGet(row["FILE_2"].ToString());
                        file.Close();
                    }
                }
                else if ("FILE3".Equals(view.Columns[e.ColumnIndex].Name))
                {
                    if (!"".Equals(row["FILE_3"].ToString()))
                    {
                        FileGet file = new FileGet(row["FILE_3"].ToString());
                        file.Close();
                    }
                }
                else if ("FILE4".Equals(view.Columns[e.ColumnIndex].Name))
                {
                    if (!"".Equals(row["FILE_4"].ToString()))
                    {
                        FileGet file = new FileGet(row["FILE_4"].ToString());
                        file.Close();
                    }
                }
                else if ("MODIFY".Equals(view.Columns[e.ColumnIndex].Name))
                {
                    var frm = new Popup.FrmInsertVendorComp()
                    {
                        CompName = row["COMP_NM"].ToString(),
                        SiteName = row["SITE_NM"].ToString(),
                        UserName = row["USER_NM"].ToString(),
                        Grade    = row["GRADE_NM"].ToString(),
                        AddrCode = row["ADDR_CD"].ToString(),
                        Addr     = row["ADDR"].ToString(),
                        Tel      = row["TEL"].ToString(),
                        Fax      = row["FAX"].ToString(),
                        Mail     = row["EMAIL"].ToString(),
                        HomePage = row["WEB"].ToString(),
                        Regid    = row["REG_ID"].ToString(),
                        BankCode = row["BNK_CD"].ToString(),
                        BankNo   = row["BNK_NO"].ToString()
                    };

                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        string LINK = row["LINK_CD"].ToString();

                        if (!"".Equals(frm.FILE1))
                        {
                            if (!"".Equals(row["FILE_1"].ToString()))
                            {
                                FileSender del1 = new FileSender(LINK, row["FILE_1"].ToString(), false, 'M');
                                del1.Close();
                            }

                            FileSender file1 = new FileSender(LINK, frm.FILE1, true, 'M', 1);
                            LINK = file1.GetLinkCode();
                            file1.Close();
                        }

                        if (!"".Equals(frm.FILE2))
                        {
                            if (!"".Equals(row["FILE_2"].ToString()))
                            {
                                FileSender del2 = new FileSender(LINK, row["FILE_2"].ToString(), false, 'M');
                                del2.Close();
                            }

                            FileSender file2 = new FileSender(LINK, frm.FILE2, true, 'M', 2);
                            LINK = file2.GetLinkCode();
                            file2.Close();
                        }

                        if (!"".Equals(frm.FILE3))
                        {
                            if (!"".Equals(row["FILE_3"].ToString()))
                            {
                                FileSender del3 = new FileSender(LINK, row["FILE_3"].ToString(), false, 'M');
                                del3.Close();
                            }

                            FileSender file3 = new FileSender(LINK, frm.FILE3, true, 'M', 3);
                            LINK = file3.GetLinkCode();
                            file3.Close();
                        }

                        if (!"".Equals(frm.FILE4))
                        {
                            if (!"".Equals(row["FILE_4"].ToString()))
                            {
                                FileSender del4 = new FileSender(LINK, row["FILE_4"].ToString(), false, 'M');
                                del4.Close();
                            }

                            FileSender file4 = new FileSender(LINK, frm.FILE4, true, 'M', 4);
                            LINK = file4.GetLinkCode();
                            file4.Close();
                        }

                        ClearSearchData();
                        SetSearchData("COMP_CODE", row["COMP_CD"]);
                        SetSearchData("COMP_NAME", frm.CompName);
                        SetSearchData("SITE_NAME", frm.SiteName);
                        SetSearchData("COMP_TYPE", "V");
                        SetSearchData("USER_NAME", frm.UserName);
                        SetSearchData("GRADE_NM", frm.Grade);
                        SetSearchData("ADDR_CODE", frm.AddrCode);
                        SetSearchData("ADDR", frm.Addr);
                        SetSearchData("TEL_1", frm.Tel);
                        SetSearchData("FAX", frm.Fax);
                        SetSearchData("EMAIL", frm.Mail);
                        SetSearchData("HOMEPAGE", frm.HomePage);
                        SetSearchData("BANK_CODE", frm.BankCode);
                        SetSearchData("BANK_NO", frm.BankNo);
                        SetSearchData("REG_ID", frm.Regid);
                        SetSearchData("LINK_CODE", LINK);
                        SetSearchData("UPT_USER_ID", DTOFactory.UserId);
                        SetServiceId("SetCompInfo");

                        try
                        {
                            DTOFactory.Transaction(new MemberDTO());
                            DataSet ds = DTOFactory.GetDataSet();

                            ViewMessage.Info("수정이 완료되었습니다.");

                            _dtComp            = ds.Tables["ds_comp"];
                            gd_List.DataSource = _dtComp;
                            _dtUser.Rows.Clear();
                        }
                        catch (Exception ex)
                        {
                            ViewMessage.Error(ex.Message);
                        }
                    }
                }
                else if ("DEL".Equals(view.Columns[e.ColumnIndex].Name))
                {
                    if (!"".Equals(row["COMP_CD"].ToString()))
                    {
                        if (System.Windows.Forms.MessageBox.Show(
                                row["COMP_NM"].ToString() + " 업체 정보를 삭제 하시겠습니까?", "업체 제거"
                                , MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            ClearSearchData();
                            SetSearchData("COMP_CODE", row["COMP_CD"].ToString());
                            SetServiceId("RemoveComp");

                            try
                            {
                                DTOFactory.Transaction(new MemberDTO());
                                _dtComp.Rows.RemoveAt(e.RowIndex);

                                ViewMessage.Info("업체 정보가 삭제 되었습니다.");
                            }
                            catch (Exception ex)
                            {
                                ViewMessage.Error(ex.Message);
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
        private void AddCompRow(object sender, EventArgs e)
        {
            var frm = new Popup.FrmInsertVendorComp();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                string LINK = "";

                if (!"".Equals(frm.FILE1))
                {
                    FileSender file1 = new FileSender(LINK, frm.FILE1, true, 'M', 1);
                    LINK = file1.GetLinkCode();
                    file1.Close();
                }

                if (!"".Equals(frm.FILE2))
                {
                    FileSender file2 = new FileSender(LINK, frm.FILE2, true, 'M', 2);
                    LINK = file2.GetLinkCode();
                    file2.Close();
                }

                if (!"".Equals(frm.FILE3))
                {
                    FileSender file3 = new FileSender(LINK, frm.FILE3, true, 'M', 3);
                    LINK = file3.GetLinkCode();
                    file3.Close();
                }

                if (!"".Equals(frm.FILE4))
                {
                    FileSender file4 = new FileSender(LINK, frm.FILE4, true, 'M', 4);
                    LINK = file4.GetLinkCode();
                    file4.Close();
                }

                ClearSearchData();
                SetSearchData("COMP_NAME", frm.CompName);
                SetSearchData("SITE_NAME", frm.SiteName);
                SetSearchData("COMP_TYPE", "V");
                SetSearchData("USER_NAME", frm.UserName);
                SetSearchData("GRADE_NM", frm.Grade);
                SetSearchData("ADDR_CODE", frm.AddrCode);
                SetSearchData("ADDR", frm.Addr);
                SetSearchData("TEL_1", frm.Tel);
                SetSearchData("FAX", frm.Fax);
                SetSearchData("EMAIL", frm.Mail);
                SetSearchData("HOMEPAGE", frm.HomePage);
                SetSearchData("BANK_CODE", frm.BankCode);
                SetSearchData("BANK_NO", frm.BankNo);
                SetSearchData("REG_ID", frm.Regid);
                SetSearchData("LINK_CODE", LINK);
                SetSearchData("UPT_USER_ID", DTOFactory.UserId);
                SetServiceId("SetCompInfo");

                try
                {
                    DTOFactory.Transaction(new MemberDTO());
                    DataSet ds = DTOFactory.GetDataSet();

                    ViewMessage.Info("저장이 완료되었습니다.");

                    _dtComp = ds.Tables["ds_comp"];
                    _dtUser.Rows.Clear();
                }
                catch (Exception ex)
                {
                    ViewMessage.Error(ex.Message);
                }
            }
        }