Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
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);
            }
        }
Ejemplo n.º 6
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);
            }
        }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
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;
            }
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
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);
            }
        }
Ejemplo n.º 11
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);
            }
        }
Ejemplo n.º 12
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);
            }
        }
Ejemplo n.º 13
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;
            }
        }
Ejemplo n.º 14
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;
     }
 }
Ejemplo n.º 15
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);
            }
        }
Ejemplo n.º 16
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);
            }
        }
Ejemplo n.º 17
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);
            }
        }
Ejemplo n.º 18
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);
            }
        }
Ejemplo n.º 19
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);
            }
        }
Ejemplo n.º 20
0
        protected override void DataLoad(object param = null)
        {
            try
            {
                DataMap p = new DataMap();
                p.SetValue("ST_SALE_DATE", datSaleDate.DateFrEdit.GetDateChar8());
                p.SetValue("ED_SALE_DATE", datSaleDate.DateToEdit.GetDateChar8());

                var res = DBTranHelper.GetData("Sales", "GetSaleStat", p);

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

                if (res.TranList.Length > 0)
                {
                    gridSaleProduct.DataSource = (res.TranList[0].Data as List <DataMap>).DataMapListToDataTable("Data1");
                }

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

                if (res.TranList.Length > 2)
                {
                    gridSaleCategory.DataSource = (res.TranList[2].Data as List <DataMap>).DataMapListToDataTable("Data3");
                }

                if (res.TranList.Length > 3)
                {
                    gridSalePayType.DataSource = (res.TranList[3].Data as List <DataMap>).DataMapListToDataTable("Data4");
                }
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Ejemplo n.º 21
0
        private void GetSaleAmount()
        {
            try
            {
                var res = DBTranHelper.GetData("Sales", "GetSaleSumData", null);
                if (res.TranList.Length > 0)
                {
                    if (res.TranList[0].Data == null)
                    {
                        throw new Exception("조회 데이터가 없습니다.");
                    }

                    SaleSumDataModel model = res.TranList[0].Data as SaleSumDataModel;
                    esDaySaleCount.Text  = string.Format("{0:N0}", model.SALE_DAY_COUNT);
                    esDaySaleAmount.Text = string.Format("{0:N0}", model.SALE_DAY_AMOUNT);
                    esMonSaleAmount.Text = string.Format("{0:N0}", model.SALE_MON_AMOUNT);
                }
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Ejemplo n.º 22
0
        void DetailDataLoad(object id)
        {
            try
            {
                DataMap data = (DataMap)DBTranHelper.GetData("Base", "GetData", "SelectUsers", new DataMap()
                {
                    { "USER_ID", id }
                }).TranList[0].Data;
                if (data == null)
                {
                    throw new Exception("조회할 데이터가 없습니다.");
                }

                txtUserId.EditValue   = data.GetValue("USER_ID");
                txtUserName.EditValue = data.GetValue("USER_NAME");
                lupUserType.EditValue = data.GetValue("USER_TYPE");
                txtLoginId.EditValue  = data.GetValue("LOGIN_ID");
                chkUseYn.EditValue    = data.GetValue("USE_YN");
                memeRemarks.EditValue = data.GetValue("REMARKS");

                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;
                txtUserName.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Ejemplo n.º 23
0
        private void InputEnter()
        {
            try
            {
                if (SaleInputMode == SaleInputMode.Item)
                {
                    if (txtInput.EditValue.ToStringNullToEmpty().IsNullOrEmpty() == false)
                    {
                        var res = DBTranHelper.GetData <DataMap>("Product", "GetDataByBarcode", new DataMap()
                        {
                            { "BARCODE", txtInput.EditValue }
                        });
                        if (res == null)
                        {
                            throw new Exception("데이터가 정확하지 않습니다.");
                        }

                        SetSaleItem(new SaleTranItemDataModel()
                        {
                            PRODUCT_ID   = res.GetValue("PRODUCT_ID").ToIntegerNullToZero(),
                            PRODUCT_CODE = res.GetValue("PRODUCT_CODE").ToStringNullToEmpty(),
                            PRODUCT_NAME = res.GetValue("PRODUCT_NAME").ToStringNullToEmpty(),
                            SALE_PRICE   = res.GetValue("SALE_PRICE").ToIntegerNullToZero(),
                            DISC_RATE    = 0,
                            DISC_PRICE   = res.GetValue("SALE_PRICE").ToIntegerNullToZero(),
                            SALE_QTY     = (lupSaleType.EditValue.ToString() == "0") ? 1 : -1,
                            SALE_AMT     = res.GetValue("SALE_PRICE").ToIntegerNullToZero(),
                            DISC_AMT     = 0,
                            NPAY_AMT     = res.GetValue("SALE_PRICE").ToIntegerNullToZero(),
                            DISC_TYPE    = "00"
                        });
                        txtInput.Focus();
                    }
                }
                else if (SaleInputMode == SaleInputMode.ChangeQty)
                {
                    if (txtInput.EditValue.ToStringNullToEmpty().IsNumeric() == false)
                    {
                        ShowMsgBox("변경할 수량을 숫자로 입력하세요.");
                        txtInput.Clear();
                        txtInput.Focus();
                    }
                    else
                    {
                        if (gridItems.FocusedRowHandle < 0)
                        {
                            return;
                        }

                        int rowIndex = gridItems.FocusedRowHandle;
                        int qty      = txtInput.EditValue.ToIntegerNullToZero();

                        gridItems.SetValue(rowIndex, "SALE_QTY", qty);
                        gridItems.UpdateCurrentRow();

                        CalcSaleItem(gridItems.FocusedRowHandle);

                        SetSaleInputMode(SaleInputMode.Item);
                        txtInput.Clear();
                        txtInput.Focus();
                    }
                }
                else if (SaleInputMode == SaleInputMode.DiscountRate)
                {
                    if (txtInput.EditValue.ToStringNullToEmpty().IsNumeric() == false)
                    {
                        ShowMsgBox("할인율은 숫자로 입력해야 합니다.");
                        txtInput.Clear();
                        txtInput.Focus();
                    }
                    else
                    {
                        if (gridItems.FocusedRowHandle < 0)
                        {
                            return;
                        }

                        int rowIndex = gridItems.FocusedRowHandle;
                        int dcRate   = txtInput.EditValue.ToIntegerNullToZero();

                        gridItems.SetValue(rowIndex, "DISC_RATE", dcRate);
                        gridItems.SetValue(rowIndex, "DISC_TYPE", "10");
                        gridItems.UpdateCurrentRow();

                        CalcSaleItem(gridItems.FocusedRowHandle);

                        SetSaleInputMode(SaleInputMode.Item);
                        txtInput.Clear();
                        txtInput.Focus();
                    }
                }
                else if (SaleInputMode == SaleInputMode.DiscountAmount)
                {
                    if (txtInput.EditValue.ToStringNullToEmpty().IsNumeric() == false)
                    {
                        ShowMsgBox("할인액은 숫자로 입력해야 합니다.");
                        txtInput.Clear();
                        txtInput.Focus();
                    }
                    else
                    {
                        if (gridItems.FocusedRowHandle < 0)
                        {
                            return;
                        }

                        int rowIndex = gridItems.FocusedRowHandle;
                        int discAmt  = txtInput.EditValue.ToIntegerNullToZero();

                        gridItems.SetValue(rowIndex, "DISC_RATE", 0);
                        gridItems.SetValue(rowIndex, "DISC_AMT", discAmt);
                        gridItems.SetValue(rowIndex, "DISC_TYPE", "20");
                        gridItems.UpdateCurrentRow();

                        CalcSaleItem(gridItems.FocusedRowHandle);

                        SetSaleInputMode(SaleInputMode.Item);
                        txtInput.Clear();
                        txtInput.Focus();
                    }
                }
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Ejemplo n.º 24
0
        void DetailDataLoad(object id)
        {
            try
            {
                var res = DBTranHelper.GetData("Customer", new DataMap()
                {
                    { "CUSTOMER_ID", id }
                });

                if (res == null)
                {
                    throw new Exception("처리결과를 수신하지 못했습니다.");
                }

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

                if (res.TranList == null || res.TranList.Length == 0)
                {
                    throw new Exception("처리결과 데이터가 없습니다.");
                }

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

                    DataMap data = res.TranList[0].Data as DataMap;

                    txtCustomerId.EditValue   = data.GetValue("CUSTOMER_ID");
                    txtCustomerName.EditValue = data.GetValue("CUSTOMER_NAME");
                    lupCustomerType.EditValue = data.GetValue("CUSTOMER_TYPE");
                    txtEmail.EditValue        = data.GetValue("EMAIL");
                    txtHpage.EditValue        = data.GetValue("HPAGE");
                    chkUseYn.EditValue        = data.GetValue("USE_YN");
                    memRemarks.EditValue      = data.GetValue("REMARKS");

                    mBizRegId             = data.GetValue("BIZ_REG_ID");
                    txtBizRegNo.EditValue = data.GetValue("BIZ_REG_NO");
                    txtBizName.EditValue  = data.GetValue("BIZ_NAME");
                    txtRepName.EditValue  = data.GetValue("REP_NAME");
                    txtBizType.EditValue  = data.GetValue("BIZ_TYPE");
                    txtBizItem.EditValue  = data.GetValue("BIZ_ITEM");

                    mAddressId            = data.GetValue("ADDRESS_ID");
                    txtPostNo.EditValue   = data.GetValue("POST_NO");
                    txtZoneNo.EditValue   = data.GetValue("ZONE_NO");
                    txtAddress1.EditValue = data.GetValue("ADDRESS1");
                    txtAddress2.EditValue = data.GetValue("ADDRESS2");

                    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");
                }

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

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

                btnAddressSave.Enabled   =
                    btnPhoneSave.Enabled = true;

                SetToolbarButtons(new ToolbarButtons()
                {
                    New = true, Refresh = true, Save = true, SaveAndNew = true, Delete = true
                });
                this.EditMode = EditModeEnum.Modify;
                txtCustomerName.Focus();
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Ejemplo n.º 25
0
        public static void Init()
        {
            try
            {
                Logger.Debug("Setting Start!!");

                GlobalVar.DatabaseId = "REAL";
                GlobalVar.ServerUrl  = ServerConsts.REAL;

                GlobalVar.Settings.SetValue("IS_USESKIN", SkinConsts.IS_USESKIN);
                GlobalVar.Settings.SetValue("MAIN_SKIN", SkinConsts.MAIN_SKIN);
                GlobalVar.Settings.SetValue("FORM_SKIN", SkinConsts.FORM_SKIN);
                GlobalVar.Settings.SetValue("GRID_SKIN", SkinConsts.GRID_SKIN);
                GlobalVar.Settings.SetValue("GRID_EVEN_AND_ODD", SkinConsts.GRID_EVEN_AND_ODD);

                if (FontFamily.Families.Where(x => x.Name == SkinConsts.FONT_NAME).Any())
                {
                    GlobalVar.Settings.SetValue("FONT_NAME", SkinConsts.FONT_NAME);
                }
                else
                {
                    GlobalVar.Settings.SetValue("FONT_NAME", SystemFonts.DefaultFont.Name);
                }
                GlobalVar.Settings.SetValue("FONT_SIZE", SkinConsts.FONT_SIZE);
                AppearanceObject.DefaultFont = new Font(GlobalVar.Settings.GetValue("FONT_NAME").ToStringNullToEmpty(), (float)GlobalVar.Settings.GetValue("FONT_SIZE"));

                GlobalVar.Settings.SetValue("VISIBLE_TOOLBAR_NAME", "YES");
                GlobalVar.Settings.SetValue("COMPANY_NAME", "JW.Play");
                GlobalVar.Settings.SetValue("DEPARTMENT_NAME", "Development Division");
                GlobalVar.Settings.SetValue("USER_NAME", "Manager");
                GlobalVar.Settings.SetValue("MAINFORM_WINDOW_STATE", FormWindowState.Maximized);

                SplashUtils.ShowWait("리소스 데이터를 생성하는 중입니다... 잠시만...");

                DomainUtils.Init();

                try
                {
                    DataTable data = (DataTable)DBTranHelper.GetData("Auth", "GetSettings", "Setting", new DataMap()).TranList[0].Data;
                    if (data != null && data.Rows.Count > 0)
                    {
                        foreach (DataRow row in data.Rows)
                        {
                            GlobalVar.Settings.SetValue(row["CODE"].ToString(), row["VALUE"]);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MsgBox.Show(ex);
                }

                try
                {
                    DomainUtils.SetData();
                }
                catch (Exception ex)
                {
                    MsgBox.Show(ex);
                }
                SplashUtils.CloseWait();
                Logger.Debug("Setting End!!");
            }
            catch (Exception ex)
            {
                MsgBox.Show(ex);
            }
        }