Beispiel #1
0
        private void LoadMainMenu()
        {
            try
            {
                if (mainMenu != null)
                {
                    var list = DBTranHelper.GetData <List <MainMenuDataModel> >("Auth", "GetMainMenus", "MainMenus", new DataMap()
                    {
                        { "USER_ID", GlobalVar.Settings.GetValue("USER_ID") },
                        { "MENU_GROUP", "BIZ" }
                    });

                    if (list != null)
                    {
                        mainMenu.DataSource = list;
                        mainMenu.ExpandAll();
                        mainMenu.BestFitColumns();
                        mainMenu.Sort(new string[] { "HIER_ID" }, new SortOrder[] { SortOrder.Ascending });
                    }
                }
            }
            catch (Exception ex)
            {
                MsgBox.Show(ex);
            }
        }
Beispiel #2
0
        void DetailDataLoad(object id)
        {
            try
            {
                var res = DBTranHelper.GetData <InvAdjsDataModel>("InvAdjs", new DataMap()
                {
                    { "ADJS_ID", id }
                });

                txtAdjsId.EditValue = res.ADJS_ID;
                datAdjsDate.SetDateChar8(res.ADJS_DATE);
                txtProductId.EditValue = res.PRODUCT_ID;
                txtProductId.EditText  = res.PRODUCT_NAME;
                spnAdjsQty.EditValue   = res.ADJS_QTY;
                memRemarks.EditValue   = res.REMARKS;

                txtInsTime.EditValue     = res.INS_TIME;
                txtInsUserName.EditValue = res.INS_USER_NAME;
                txtUpdTime.EditValue     = res.UPD_TIME;
                txtUpdUserName.EditValue = res.UPD_USER_NAME;

                SetToolbarButtons(new ToolbarButtons()
                {
                    New = true, Refresh = true, Save = true, SaveAndNew = true, Delete = true
                });
                this.EditMode = EditModeEnum.Modify;
                txtProductId.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #3
0
        void DetailDataLoad(object id)
        {
            try
            {
                DataMap res = (DataMap)DBTranHelper.GetData("Base", "GetData", "SelectCalendar", new DataMap()
                {
                    { "CAL_DATE", id }
                }).TranList[0].Data;
                if (res == null)
                {
                    throw new Exception("조회할 데이터가 없습니다.");
                }

                datCalDate.SetDateChar8(res.GetValue("CAL_DATE"));
                chkHolidayYn.EditValue   = res.GetValue("HOLIDAY_YN");
                txtHolidayName.EditValue = res.GetValue("HOLIDAY_NAME");
                memRemarks.EditValue     = res.GetValue("REMARKS");
                txtInsTime.EditValue     = res.GetValue("INS_TIME");
                txtInsUser.EditValue     = res.GetValue("INS_USER_NAME");
                txtUpdTime.EditValue     = res.GetValue("UPD_TIME");
                txtUpdUser.EditValue     = res.GetValue("UPD_USER_NAME");

                SetToolbarButtons(new ToolbarButtons()
                {
                    Refresh = true, Save = true, Delete = true
                });
                this.EditMode = EditModeEnum.Modify;
                txtHolidayName.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #4
0
        void DataSaveAddress(bool reload = false)
        {
            try
            {
                DataTable dt = GetAddressData();

                if (dt == null || dt.Rows.Count == 0)
                {
                    if (reload)
                    {
                        throw new Exception("저장할 건이 없습니다.");
                    }
                }
                else
                {
                    var res = DBTranHelper.Execute("Customer", "SaveCustomerAddress", "CustomerAddress", dt, null);
                    if (res.ErrorNumber != 0)
                    {
                        throw new Exception(res.ErrorMessage);
                    }

                    if (reload)
                    {
                        ShowMsgBox("저장하였습니다.");
                        DataLoadAddress();
                    }
                }
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #5
0
        void DetailDataLoad(object reg_id)
        {
            try
            {
                var data = DBTranHelper.GetData <SalesPriceDataModel>("Product", "GetSalesPriceData", new DataMap()
                {
                    { "REG_ID", reg_id }
                });

                txtRegId.EditValue       = data.REG_ID;
                txtProductId.EditValue   = data.PRODUCT_ID;
                txtProductCode.EditValue = data.PRODUCT_CODE;
                txtProductName.EditValue = data.PRODUCT_NAME;
                datBegDate.SetDateChar8(data.BEG_DATE);
                datEndDate.SetDateChar8(data.END_DATE);
                spnSalePrice.EditValue = data.SALE_PRICE;
                memRemarks.EditValue   = data.REMARKS;

                txtInsTime.EditValue     = data.INS_TIME;
                txtInsUserName.EditValue = data.INS_USER_NAME;
                txtUpdTime.EditValue     = data.UPD_TIME;
                txtUpdUserName.EditValue = data.UPD_USER_NAME;

                SetToolbarButtons(new ToolbarButtons()
                {
                    New = true, Refresh = true, Save = true, SaveAndNew = true, Delete = true
                });
                this.EditMode = EditModeEnum.Modify;
                spnSalePrice.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #6
0
        protected override void DataSave(object arg, SaveCallback callback)
        {
            try
            {
                DataMap data = new DataMap()
                {
                    { "USER_ID", txtUserId.EditValue },
                    { "USER_NAME", txtUserName.EditValue },
                    { "USER_TYPE", lupUserType.EditValue },
                    { "LOGIN_ID", txtLoginId.EditValue },
                    { "USE_YN", chkUseYn.EditValue },
                    { "REMARKS", memeRemarks.EditValue },
                    { "ROWSTATE", (this.EditMode == EditModeEnum.New)?"INSERT":"UPDATE" }
                };

                var res = DBTranHelper.Execute("Base", "Save", "User", data, "USER_ID");
                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("저장하였습니다.");
                callback(arg, res.TranList[0].ReturnValue);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #7
0
        void doCreate()
        {
            if (MsgBox.Show("선택한 연도의 캘린더를 생성하겠습니까?", "확인!!", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }

            try
            {
                var res = DBTranHelper.ProcedureCall("CreateCalendar", new DataMap()
                {
                    { "CAL_YEAR", datCalYear.GetDateChar4().ToIntegerNullToZero() }
                });
                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("생성하였습니다.");
                DataLoad(null);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #8
0
        void DetailDataLoad(object id)
        {
            try
            {
                DataMap data = (DataMap)DBTranHelper.GetData("Base", "GetData", "SelectDictionaries", new DataMap()
                {
                    { "DICTIONARY_ID", id }
                }).TranList[0].Data;
                if (data == null)
                {
                    throw new Exception("조회할 데이터가 없습니다.");
                }

                txtDictionaryId.EditValue = data.GetValue("DICTIONARY_ID");
                txtLogicalName.EditValue  = data.GetValue("LOGICAL_NAME");
                txtPhysicalName.EditValue = data.GetValue("PHYSICAL_NAME");
                memDescription.EditValue  = data.GetValue("DESCRIPTION");
                txtInsTime.EditValue      = data.GetValue("INS_TIME");
                txtInsUser.EditValue      = data.GetValue("INS_USER_NAME");
                txtUpdTime.EditValue      = data.GetValue("UPD_TIME");
                txtUpdUser.EditValue      = data.GetValue("UPD_USER_NAME");

                SetToolbarButtons(new ToolbarButtons()
                {
                    New = true, Refresh = true, Save = true, SaveAndNew = true, Delete = true
                });
                this.EditMode = EditModeEnum.Modify;
                txtLogicalName.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #9
0
        protected override void DataSave(object arg, SaveCallback callback)
        {
            try
            {
                DataMap data = new DataMap()
                {
                    { "DICTIONARY_ID", txtDictionaryId.EditValue },
                    { "LOGICAL_NAME", txtLogicalName.EditValue },
                    { "PHYSICAL_NAME", txtPhysicalName.EditValue },
                    { "DESCRIPTION", memDescription.EditValue },
                    { "ROWSTATE", (this.EditMode == EditModeEnum.New) ? "INSERT" : "UPDATE" }
                };

                var res = DBTranHelper.Execute("Base", "Save", "Dictionary", data, "DICTIONARY_ID");
                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("저장하였습니다.");
                callback(arg, res.TranList[0].ReturnValue);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #10
0
        public static void SetData()
        {
            try
            {
                var dtDictionaries = DBTranHelper.GetData <DataTable>("Auth", "GetDictionaries", "Dictionaries", null);
                if (dtDictionaries != null && (dtDictionaries as DataTable).Rows.Count > 0)
                {
                    foreach (DataRow dr in (dtDictionaries as DataTable).Rows)
                    {
                        DomainResource.Fields.SetValue(dr["NAME"].ToString(), dr["VALUE"].ToString());
                    }
                }

                var dtMessages = DBTranHelper.GetData <DataTable>("Auth", "GetMessages", "Messages", null);
                if (dtMessages != null && (dtMessages as DataTable).Rows.Count > 0)
                {
                    foreach (DataRow dr in (dtMessages as DataTable).Rows)
                    {
                        DomainResource.Messages.SetValue(dr["NAME"].ToString(), dr["VALUE"].ToString());
                    }
                }
            }
            catch
            {
                throw;
            }
        }
Beispiel #11
0
        void doCreate()
        {
            if (MsgBox.Show("원가마감하겠습니까?", "확인!!", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }

            try
            {
                var res = DBTranHelper.ProcedureCall("CreateCostPrice", new DataMap()
                {
                    { "CLOSING_YM", datClosingYm.GetDateChar6() }
                });
                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("생성하였습니다.");
                DataLoad(null);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #12
0
        public void SetRepositoryItemLookUpEdit(string fieldName, string valueMember, string displayMember, string serviceId, string processId, string sqlId, DataMap parameters)
        {
            RepositoryItemLookUpEdit edit = GetRepositoryItemLookUpEdit(valueMember, displayMember);

            edit.DataSource = DBTranHelper.GetData(serviceId, processId, sqlId, parameters).TranList[0].Data;
            SetRepositoryItem(fieldName, edit);
        }
Beispiel #13
0
        /// <summary>
        /// 데이터 바인딩
        /// </summary>
        /// <param name="serverId">서비스ID</param>
        /// <param name="processId">프로세스ID</param>
        /// <param name="sqlId">SQL ID</param>
        /// <param name="param">파라미터</param>
        /// <param name="bestFit">자동맞춤여부</param>
        public void BindData(string serviceId = null, string processId = null, string sqlId = null, DataMap param = null, bool bestFit = false)
        {
            try
            {
                int rowIndex = this.MainView.FocusedRowHandle;
                this.DataSource = DBTranHelper.GetData(serviceId, processId, sqlId, param).TranList[0].Data;
                if (this.DataSource == null)
                {
                    this.EmptyDataTableBinding();
                }
                else
                {
                    this.MainView.FocusedRowHandle = rowIndex;
                    this.MainView.SelectRow(rowIndex);
                }

                if (bestFit)
                {
                    BestFitColumns();
                }
            }
            catch (Exception ex)
            {
                MsgBox.Show(ex);
            }
        }
Beispiel #14
0
        void DetailDataLoad(object id)
        {
            try
            {
                var data = DBTranHelper.GetData <DataMap>("Base", "GetData", "GetDepositData", new DataMap()
                {
                    { "DEPOSIT_ID", id }
                });

                txtDepositId.EditValue = data.GetValue("DEPOSIT_ID");
                datDepositDate.SetDateChar8(data.GetValue("DEPOSIT_DATE"));
                txtCustomerId.EditValue = data.GetValue("CUSTOMER_ID");
                txtCustomerId.EditText  = data.GetValue("CUSTOMER_NAME");
                spnDepositAmt.EditValue = data.GetValue("DEPOSIT_AMT");
                memRemarks.EditValue    = data.GetValue("REMARKS");

                txtInsTime.EditValue     = data.GetValue("INS_TIME");
                txtInsUserName.EditValue = data.GetValue("INS_USER_NAME");
                txtUpdTime.EditValue     = data.GetValue("UPD_TIME");
                txtUpdUserName.EditValue = data.GetValue("UPD_USER_NAME");

                SetToolbarButtons(new ToolbarButtons()
                {
                    New = true, Refresh = true, Save = true, SaveAndNew = true, Delete = true
                });
                this.EditMode = EditModeEnum.Modify;
                txtCustomerId.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #15
0
        private void LoadSystemMenu()
        {
            try
            {
                if (navBarNavigate != null && navBarNavigate.Groups.Where(x => x.Name == "navBarGroupSystem").Any())
                {
                    var navGroup = navBarNavigate.Groups.Where(x => x.Name == "navBarGroupSystem").FirstOrDefault();
                    navGroup.ItemLinks.Clear();

                    var list = DBTranHelper.GetData <List <MainMenuDataModel> >("Auth", "GetMainMenus", "MainMenus", new DataMap()
                    {
                        { "USER_ID", GlobalVar.Settings.GetValue("USER_ID") },
                        { "MENU_GROUP", "SYS" }
                    });

                    if (list != null)
                    {
                        foreach (MainMenuDataModel model in list)
                        {
                            navGroup.ItemLinks.Add(navBarNavigate.Items.Add(new NavBarItem()
                            {
                                Caption        = model.MENU_NAME.ToStringNullToEmpty(),
                                Tag            = model,
                                SmallImage     = ImageResource.menu_system_16x16,
                                SmallImageSize = new Size(16, 16)
                            }));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MsgBox.Show(ex);
            }
        }
Beispiel #16
0
        void doConfirm()
        {
            if (txtCurPwd.EditValue.IsNullOrEmpty())
            {
                MsgBox.Show("현재 비밀번호를 입력하세요!!!");
                txtCurPwd.Focus();
                return;
            }

            if (txtChgPwd.EditValue.IsNullOrEmpty())
            {
                MsgBox.Show("변경할 비밀번호를 입력하세요!!!");
                txtCurPwd.Focus();
                return;
            }

            if (txtChkPwd.EditValue.IsNullOrEmpty())
            {
                MsgBox.Show("변경할 비밀번호를 비밀번호 확인란에 한번 더 입력하세요!!!");
                txtCurPwd.Focus();
                return;
            }

            if (txtChgPwd.EditValue.ToStringNullToEmpty() != txtChkPwd.EditValue.ToStringNullToEmpty())
            {
                MsgBox.Show("변경할 비밀번호와 비밀번호 확인이 일치해야 합니다.");
                txtChgPwd.Focus();
                return;
            }

            if (txtCurPwd.EditValue.ToStringNullToEmpty() == txtChgPwd.EditValue.ToStringNullToEmpty())
            {
                MsgBox.Show("기존 비밀번호와 변경할 비밀번호가 일치합니다. 다시 입력하세요!!!");
                txtChgPwd.Focus();
                return;
            }

            try
            {
                var ret = DBTranHelper.Execute("Auth", "ChangePassword", null, new DataMap()
                {
                    { "LOGIN_ID", GlobalVar.Settings.GetValue("LOGIN_ID") },
                    { "LOGIN_PW", txtCurPwd.EditValue },
                    { "CHG_LOGIN_PW", txtChgPwd.EditValue }
                }, null);

                if (ret.ErrorNumber != 0)
                {
                    throw new Exception(ret.ErrorMessage);
                }

                MsgBox.Show("변경하였습니다.");
                Close();
            }
            catch (Exception ex)
            {
                MsgBox.Show(ex);
            }
        }
Beispiel #17
0
        private void doLogin()
        {
            try
            {
                if (txtCompanyId.EditValue.ToStringNullToEmpty() == string.Empty)
                {
                    MsgBox.Show("회사코드를 입력해야 합니다.");
                    txtCompanyId.Focus();
                    return;
                }

                if (txtLoginId.EditValue.ToStringNullToEmpty() == string.Empty)
                {
                    MsgBox.Show("접속 아이디를 입력하세요!!!");
                    txtLoginId.Focus();
                    return;
                }

                if (txtPassword.EditValue.ToStringNullToEmpty() == string.Empty)
                {
                    MsgBox.Show("비밀번호를 입력하세요!!!");
                    txtPassword.Focus();
                    return;
                }

                var data = DBTranHelper.GetData("Auth", "CheckLoginUser", null, new DataMap()
                {
                    { "LOGIN_ID", txtLoginId.EditValue },
                    { "LOGIN_PW", txtPassword.EditValue }
                }).TranList[0].Data;

                if (data == null)
                {
                    throw new Exception("로그인 사용자의 정보가 정확하지 않습니다.");
                }

                GlobalVar.Settings.SetValue("LOGIN_ID", (data as LoginUserDataModel).LOGIN_ID);
                GlobalVar.Settings.SetValue("USER_ID", (data as LoginUserDataModel).USER_ID);
                GlobalVar.Settings.SetValue("USER_NAME", (data as LoginUserDataModel).USER_NAME);

                if (chkRemember.Checked)
                {
                    RegistryUtils.SetValue(RegiPathConsts.LOGIN_INFO, "LoginId", txtLoginId.EditValue.ToStringNullToEmpty());
                    RegistryUtils.SetValue(RegiPathConsts.LOGIN_INFO, "LoginPw", txtPassword.EditValue.ToStringNullToEmpty());
                }

                SetModifiedCount();
                Close();
            }
            catch (Exception ex)
            {
                MsgBox.Show(ex);
            }
        }
Beispiel #18
0
        public static void ShowHelp(object helpId, object menuId = null)
        {
            if (helpId == null && menuId == null)
            {
                return;
            }
            try
            {
                string textValue;
                string rtfValue;
                string helpName;

                DataMap data = (DataMap)DBTranHelper.GetData("Auth", "GetHelpContent", null, new DataMap()
                {
                    { "HELP_ID", helpId }, { "MENU_ID", menuId }
                }).TranList[0].Data;
                if (data != null)
                {
                    helpId    = data.GetValue("ID");
                    helpName  = data.GetValue("NAME").ToStringNullToEmpty();
                    rtfValue  = data.GetValue("CONTENT_BY_RTE").ToStringNullToEmpty();
                    textValue = data.GetValue("CONTENT").ToStringNullToEmpty();

                    if (rtfValue.IsNullOrEmpty() == false || textValue.IsNullOrEmpty() == false)
                    {
                        HelpForm form = new HelpForm()
                        {
                            Name = string.Format("HELP_{0}", helpId), Text = "[도움말]", Subject = helpName
                        };
                        if (rtfValue.IsNullOrEmpty())
                        {
                            form.Content = textValue;
                        }
                        else
                        {
                            form.ContentByRte = rtfValue;
                        }
                        form.InsertDtime    = data.GetValue("INS_TIME").ToStringNullToEmpty();
                        form.InsertUserName = data.GetValue("INS_USER_NAME").ToStringNullToEmpty();
                        form.UpdateDtime    = data.GetValue("UPD_TIME").ToStringNullToEmpty();
                        form.UpdateUserName = data.GetValue("UPD_USER_ID").ToStringNullToEmpty();
                        form.StartPosition  = FormStartPosition.CenterScreen;
                        form.TopMost        = true;
                        form.Show();
                    }
                }
            }
            catch
            {
                throw;
            }
        }
Beispiel #19
0
        void DetailDataLoad(object id)
        {
            try
            {
                var res = DBTranHelper.GetData("Product", new DataMap()
                {
                    { "PRODUCT_ID", id }
                });
                if (res.TranList.Length > 0)
                {
                    if (res.TranList[0].Data == null)
                    {
                        throw new Exception("조회 데이터가 없습니다.");
                    }

                    ProductDataModel model = (ProductDataModel)res.TranList[0].Data;

                    txtProductId.EditValue   = model.PRODUCT_ID;
                    txtProductCode.EditValue = model.PRODUCT_CODE;
                    txtProductName.EditValue = model.PRODUCT_NAME;
                    txtBarcode.EditValue     = model.BARCODE;
                    lupProductType.EditValue = model.PRODUCT_TYPE;
                    lupCategory.EditValue    = model.CATEGORY;
                    lupUnitType.EditValue    = model.UNIT_TYPE;
                    chkUseYn.EditValue       = model.USE_YN;
                    memRemarks.EditValue     = model.REMARKS;

                    txtInsTime.EditValue     = model.INS_TIME;
                    txtInsUserName.EditValue = model.INS_USER_NAME;
                    txtUpdTime.EditValue     = model.UPD_TIME;
                    txtUpdUserName.EditValue = model.UPD_USER_NAME;
                }

                if (res.TranList.Length > 1)
                {
                    gridMaterials.DataSource = (res.TranList[1].Data as List <DataMap>).DataMapListToDataTable();
                }

                onProductTypeChanged();

                SetToolbarButtons(new ToolbarButtons()
                {
                    New = true, Refresh = true, Save = true, SaveAndNew = true, Delete = true
                });
                this.EditMode = EditModeEnum.Modify;
                txtProductName.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #20
0
        protected override void DataSave(object arg, SaveCallback callback)
        {
            if (DataValidate() == false)
            {
                return;
            }
            if (DataValidate(gridItem) == false)
            {
                return;
            }

            try
            {
                DataMap mst = lc.GroupToDataMap(lcGroupEdit1, lcGroupEdit2);
                mst.SetValue("ROWSTATE", (this.EditMode == EditModeEnum.New) ? "INSERT" : "UPDATE");

                DataTable item = GetPurcItemData();
                if (item == null || item.Rows.Count == 0)
                {
                    throw new Exception("구매품목을 입력해야 합니다.");
                }

                var res = DBTranHelper.Execute(new DBTranSet()
                {
                    ServiceId = "Purchase",
                    ProcessId = "Save",
                    TranList  = new DBTranData[]
                    {
                        new DBTranData()
                        {
                            Data = mst
                        },
                        new DBTranData()
                        {
                            Data = item
                        }
                    }
                });
                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("저장하였습니다.");
                callback(arg, res.TranList[0].ReturnValue);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #21
0
 public static DataTable Lookup(string parentCodeId, DataMap parameters = null)
 {
     try
     {
         if (parameters == null)
         {
             parameters = new DataMap();
         }
         parameters.SetValue("PARENT_CODE", parentCodeId);
         return(DBTranHelper.GetData <DataTable>("CodeHelp", "GetCodeHelpLookup", parameters));
     }
     catch
     {
         throw;
     }
 }
Beispiel #22
0
        protected override void DataSave(object arg, SaveCallback callback)
        {
            try
            {
                DataMap data = new DataMap()
                {
                    { "ID", txtTableId.EditValue },
                    { "DB_NAME", lupDbName.EditValue },
                    { "SCHEMA_NAME", txtSchemaName.EditValue },
                    { "TABLE_NAME", txtTableName.EditValue },
                    { "DESCRIPTION", txtDescription.EditValue },
                    { "REMARKS", memRemarks.EditValue },
                    { "ROWSTATE", (txtTableId.EditValue.IsNullOrEmpty()) ? "INSERT" : "UPDATE" }
                };

                DataTable dtColumns = GetColumnData();

                var res = DBTranHelper.Execute(new DBTranSet()
                {
                    ServiceId     = "Database",
                    ProcessId     = "Save",
                    IsTransaction = true,
                    TranList      = new DBTranData[]
                    {
                        new DBTranData()
                        {
                            SqlId = "Tables", Data = data, IsMaster = true, KeyField = "ID"
                        },
                        new DBTranData()
                        {
                            SqlId = "Columns", Data = dtColumns
                        }
                    }
                });
                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("저장하였습니다.");
                DataLoad();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #23
0
        protected override void DataSave(object arg, SaveCallback callback)
        {
            try
            {
                DataTable dt = lc.GroupToDataTable(lcGroupEdit, lcGroupBizEdit)
                               .SetValue("BIZ_REG_ID", mBizRegId)
                               .SetValue("ADDRESS_ID", mAddressId)
                               .SetValue("ROWSTATE", (this.EditMode == EditModeEnum.New) ? "INSERT" : "UPDATE");

                var res = DBTranHelper.Execute(new DBTranSet()
                {
                    ServiceId = "Customer",
                    ProcessId = "Save",
                    TranList  = new DBTranData[]
                    {
                        new DBTranData()
                        {
                            Data = dt
                        },
                        new DBTranData()
                        {
                            Data = GetPhoneData()
                        },
                        new DBTranData()
                        {
                            Data = GetAddressData()
                        }
                    }
                });
                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                txtCustomerId.EditValue = res.TranList[0].ReturnValue;

                DataSavePhones();
                DataSaveAddress();

                ShowMsgBox("저장하였습니다.");
                callback(arg, res.TranList[0].ReturnValue);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #24
0
        void DataLoad(DataMap parameters)
        {
            try
            {
                var res = DBTranHelper.GetData("Purchase", parameters);

                if (res.TranList[0].Data == null)
                {
                    throw new Exception("조회 데이터가 없습니다.");
                }

                PurcTranDataModel model = res.TranList[0].Data as PurcTranDataModel;

                txtPurcId.EditValue = model.PURC_ID;
                txtPurcNo.EditValue = model.PURC_NO;
                datPurcDate.SetDateChar8(model.PURC_DATE);
                lupPurcType.EditValue   = model.PURC_TYPE;
                txtCustomerId.EditValue = model.CUSTOMER_ID;
                txtCustomerId.EditText  = model.CUSTOMER_NAME;
                memRemarks.EditValue    = model.REMARKS;

                txtInsTime.EditValue     = model.INS_TIME;
                txtInsUserName.EditValue = model.INS_USER_NAME;
                txtUpdTime.EditValue     = model.UPD_TIME;
                txtUpdUserName.EditValue = model.UPD_USER_NAME;

                this.ParamsData = model.PURC_ID;

                if (res.TranList.Length > 1)
                {
                    gridItem.DataSource = (res.TranList[1].Data as IList <PurcTranItemDataModel>).ListToDataTable();
                }

                SetToolbarButtons(new Models.ToolbarButtons()
                {
                    Refresh = true, New = true, Save = true, SaveAndNew = true, Delete = true
                });
                this.EditMode = EditModeEnum.Modify;
                memRemarks.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #25
0
        void DetailDataLoad(object id)
        {
            try
            {
                var res = DBTranHelper.GetData("Production", new DataMap()
                {
                    { "PROD_ID", id }
                });

                if (res.TranList.Length > 0)
                {
                    ProdTranDataModel model = res.TranList[0].Data as ProdTranDataModel;

                    txtProdId.EditValue = model.PROD_ID;
                    datProdDate.SetDateChar8(model.PROD_DATE);
                    txtProductId.EditValue = model.PRODUCT_ID;
                    txtProductId.EditText  = model.PRODUCT_NAME;
                    spnProdQty.EditValue   = model.PROD_QTY;
                    memRemarks.EditValue   = model.REMARKS;

                    txtInsTime.EditValue     = model.INS_TIME;
                    txtInsUserName.EditValue = model.INS_USER_NAME;
                    txtUpdTime.EditValue     = model.UPD_TIME;
                    txtUpdUserName.EditValue = model.UPD_USER_NAME;
                }

                if (res.TranList.Length > 1)
                {
                    gridMaterialList.DataSource = (res.TranList[1].Data as List <DataMap>).DataMapListToDataTable();
                }

                SetToolbarButtons(new ToolbarButtons()
                {
                    New = true, Refresh = true, Save = true, SaveAndNew = true, Delete = true
                });
                this.EditMode = EditModeEnum.Modify;
                txtProductId.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #26
0
        protected override void DataSave(object arg, SaveCallback callback)
        {
            try
            {
                DataMap data = new DataMap()
                {
                    { "CAL_DATE", datCalDate.GetDateChar8() },
                    { "HOLIDAY_YN", chkHolidayYn.EditValue },
                    { "HOLIDAY_NAME", txtHolidayName.EditValue },
                    { "REMARKS", memRemarks.EditValue },
                    { "ROWSTATE", "UPDATE" }
                };

                var res = DBTranHelper.Execute(new DBTranSet()
                {
                    ServiceId     = "Base",
                    ProcessId     = "Save",
                    IsTransaction = true,
                    TranList      = new DBTranData[]
                    {
                        new DBTranData()
                        {
                            SqlId    = "Calendar",
                            KeyField = "CAL_DATE",
                            Data     = data
                        }
                    }
                });

                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("저장하였습니다.");
                callback(arg, res.TranList[0].ReturnValue);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #27
0
        void DetailDataLoad(object id)
        {
            try
            {
                var data = DBTranHelper.GetData <DataMap>("Base", "GetData", "SelectCode", new DataMap()
                {
                    { "CODE_ID", id }
                });

                txtCodeId.EditValue = data.GetValue("CODE_ID");
                lupParentCode.BindData("CODE_GROUP", null, "ROOT", true);
                lupParentCode.EditValue   = data.GetValue("PARENT_CODE");
                txtCode.EditValue         = data.GetValue("CODE");
                txtName.EditValue         = data.GetValue("NAME");
                txtValue.EditValue        = data.GetValue("VALUE");
                spnSortSeq.EditValue      = data.GetValue("SORT_SEQ");
                spnMaxLength.EditValue    = data.GetValue("MAX_LENGTH");
                chkUseYn.EditValue        = data.GetValue("USE_YN");
                memDescription.EditValue  = data.GetValue("DESCRIPTION");
                txtOptionValue1.EditValue = data.GetValue("OPTION_VALUE1");
                txtOptionValue2.EditValue = data.GetValue("OPTION_VALUE2");
                txtOptionValue3.EditValue = data.GetValue("OPTION_VALUE3");
                txtOptionValue4.EditValue = data.GetValue("OPTION_VALUE4");
                txtOptionValue5.EditValue = data.GetValue("OPTION_VALUE5");

                txtInsTime.EditValue = data.GetValue("INS_TIME");
                txtInsUser.EditValue = data.GetValue("INS_USER_NAME");
                txtUpdTime.EditValue = data.GetValue("UPD_TIME");
                txtUpdUser.EditValue = data.GetValue("UPD_USER_NAME");

                SetToolbarButtons(new ToolbarButtons()
                {
                    New = true, Refresh = true, Save = true, SaveAndNew = true, Delete = true
                });
                this.EditMode = EditModeEnum.Modify;
                txtCode.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #28
0
        protected override void DataSave(object arg, SaveCallback callback)
        {
            if (DataValidate() == false)
            {
                return;
            }

            try
            {
                DataMap data = new DataMap()
                {
                    { "CODE_ID", txtCodeId.EditValue },
                    { "PARENT_CODE", lupParentCode.EditValue },
                    { "CODE", txtCode.EditValue },
                    { "NAME", txtName.EditValue },
                    { "VALUE", txtValue.EditValue },
                    { "SORT_SEQ", spnSortSeq.EditValue },
                    { "MAX_LENGTH", spnMaxLength.EditValue },
                    { "USE_YN", chkUseYn.EditValue },
                    { "DESCRIPTION", memDescription.EditValue },
                    { "OPTION_VALUE1", txtOptionValue1.EditValue },
                    { "OPTION_VALUE2", txtOptionValue2.EditValue },
                    { "OPTION_VALUE3", txtOptionValue3.EditValue },
                    { "OPTION_VALUE4", txtOptionValue4.EditValue },
                    { "OPTION_VALUE5", txtOptionValue5.EditValue },
                    { "ROWSTATE", (this.EditMode == EditModeEnum.New) ? "INSERT" : "UPDATE" }
                };

                var res = DBTranHelper.Execute("Base", "Save", "Code", data, "CODE_ID");
                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("저장하였습니다.");
                callback(arg, res.TranList[0].ReturnValue);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Beispiel #29
0
        private void DataLoad()
        {
            try
            {
                var res = DBTranHelper.GetData("Sales", "GetSaleDashboard", new DataMap()
                {
                    { "SALE_DATE", DateTime.Now.ToString("yyyyMMdd") }
                });

                if (res.TranList.Length > 0)
                {
                    for (int i = 0; i < chart1.Series.Count; i++)
                    {
                        chart1.Series[i].Points.Clear();
                    }

                    var data1 = res.TranList[0].Data as List <DataMap>;
                    foreach (DataMap data in data1)
                    {
                        chart1.Series[0].Points.Add(new SeriesPoint(data.GetValue("SALE_DATE").ToString().ToDateTime(), data.GetValue("SALE_AMT").ToDecimalNullToZero()));
                    }
                }

                if (res.TranList.Length > 1)
                {
                    for (int i = 0; i < chart2.Series.Count; i++)
                    {
                        chart2.Series[i].Points.Clear();
                    }

                    var data2 = res.TranList[1].Data as List <DataMap>;
                    foreach (DataMap data in data2)
                    {
                        chart2.Series[0].Points.Add(new SeriesPoint((data.GetValue("SALE_YM").ToString() + "01").ToDateTime(), data.GetValue("SALE_AMT").ToDecimalNullToZero()));
                    }
                }
            }
            catch (Exception ex)
            {
                MsgBox.Show(ex);
            }
        }
Beispiel #30
0
        void DetailDataLoad(object id)
        {
            try
            {
                DataMap data = (DataMap)(DBTranHelper.GetData("Base", "GetData", "SelectMenu", new DataMap()
                {
                    { "MENU_ID", id }
                }).TranList[0].Data);
                if (data == null)
                {
                    throw new Exception("조회할 데이터가 없습니다.");
                }

                txtMenuId.EditValue    = data.GetValue("MENU_ID");
                txtMenuName.EditValue  = data.GetValue("MENU_NAME");
                txtParentId.EditValue  = data.GetValue("PARENT_ID");
                numSortSeq.EditValue   = data.GetValue("SORT_SEQ");
                txtAssembly.EditValue  = data.GetValue("ASSEMBLY");
                txtNamespace.EditValue = data.GetValue("NAMESPACE");
                txtInstance.EditValue  = data.GetValue("INSTANCE");
                lupFormType.EditValue  = data.GetValue("FORM_TYPE");
                chkUseYn.EditValue     = data.GetValue("USE_YN");
                memRemarks.EditValue   = data.GetValue("REMARKS");

                txtInsTime.EditValue     = data.GetValue("INS_TIME");
                txtInsUserName.EditValue = data.GetValue("INS_USER_NAME");
                txtUpdTime.EditValue     = data.GetValue("UPD_TIME");
                txtUpdUserName.EditValue = data.GetValue("UPD_USER_NAME");

                SetToolbarButtons(new ToolbarButtons()
                {
                    New = true, Refresh = true, Save = true, SaveAndNew = true, Delete = true
                });
                EditMode = EditModeEnum.Modify;
                txtMenuName.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }