private void CalcUnitPrice()
        {
            if (this.dg == null)
            {
                return;
            }
            if (this.dg.SelectedIndex == -1)
            {
                return;
            }

            switch (this.dg.SelectedIndex)
            {
            case 0:         // 上代
                this.txtUnitPrice.Text = ExCast.zCStr(ExMath.zFloor(this.retail_price * ExCast.zCInt(this.numUpCreditRate.Value) / 100, this.unit_decimal_digit));
                break;

            case 1:         // 売上単価
                this.txtUnitPrice.Text = ExCast.zCStr(ExMath.zFloor(this.sales_unit_price * ExCast.zCInt(this.numUpCreditRate.Value) / 100, this.unit_decimal_digit));
                break;

            case 2:         // 売上原価
                this.txtUnitPrice.Text = ExCast.zCStr(ExMath.zFloor(this.sales_cost_price * ExCast.zCInt(this.numUpCreditRate.Value) / 100, this.unit_decimal_digit));
                break;
            }
        }
        public bool Logoff(string random)
        {
            #region 認証処理

            string userId        = "";
            string ipAdress      = "";
            string sessionString = "";
            string personId      = "";
            string _message      = "";

            userId        = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
            ipAdress      = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]);
            sessionString = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]);
            personId      = ExCast.zCStr(HttpContext.Current.Session[ExSession.PERSON_ID]);

            _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]));
            if (_message != "")
            {
                return(false);
            }

            #endregion

            return(pvtLogoff(ipAdress, userId, sessionString, personId));
        }
Exemple #3
0
        private void txtUnitPrice_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            beforeValueDlg = "";
            if (_entityListD.Count >= DataForm.CurrentIndex)
            {
                beforeValueDlg = ExCast.zCStr(_entityListD[DataForm.CurrentIndex]._unit_price);
            }

            if (_txtUnitPrice == null)
            {
                _txtUnitPrice = ExVisualTreeHelper.FindTextBox(this.DataForm, "txtUnitPrice");
            }

            Dlg_UnitPriceSetting unitPriceDlg = new Dlg_UnitPriceSetting();

            // 税転換が内税で明細課税有りの場合
            if ((_entityH._tax_change_id == 4 || _entityH._tax_change_id == 5 || _entityH._tax_change_id == 6) && _entityListD[DataForm.CurrentIndex]._tax_division_id == 1)
            {
                unitPriceDlg.retail_price     = _entityListD[DataForm.CurrentIndex]._retail_price_before_tax;
                unitPriceDlg.sales_unit_price = _entityListD[DataForm.CurrentIndex]._sales_unit_price_before_tax;
                unitPriceDlg.sales_cost_price = _entityListD[DataForm.CurrentIndex]._sales_cost_price_before_tax;
            }
            else
            {
                unitPriceDlg.retail_price     = _entityListD[DataForm.CurrentIndex]._retail_price_skip_tax;
                unitPriceDlg.sales_unit_price = _entityListD[DataForm.CurrentIndex]._sales_unit_price_skip_tax;
                unitPriceDlg.sales_cost_price = _entityListD[DataForm.CurrentIndex]._sales_cost_price_skip_tax;
            }
            unitPriceDlg.unit_decimal_digit = _entityListD[DataForm.CurrentIndex]._unit_decimal_digit;
            unitPriceDlg.credit_rate        = _entityH._credit_rate;
            unitPriceDlg.Closed            += unitPriceDlg_Closed;
            unitPriceDlg.Show();
        }
 private void _evtDataUpdate(object errMessage, EventArgs e)
 {
     if (string.IsNullOrEmpty(ExCast.zCStr(errMessage)))
     {
         btnF12_Click(null, null);
     }
 }
Exemple #5
0
        // データ追加・更新・削除
        private void UpdateData(Common.geUpdateType upd)
        {
            object[] prm = new object[4];

            prm[0] = (int)upd;

            prm[1] = "";
            for (int i = 0; i <= _entityUserList.Count - 1; i++)
            {
                if (ExCast.zCStr(this.cmbLoginId.SelectedValue) == _entityUserList[i].id)
                {
                    prm[1] = ExCast.zCInt(_entityUserList[i].attribute1);
                }
            }
            if (ExCast.zCStr(prm[1]) == "")
            {
                return;
            }

            prm[2] = _entity;
            webService.objPerent = this;
            webService.CallWebService(_UpdWebServiceCallKbn,
                                      ExWebService.geDialogDisplayFlg.Yes,
                                      ExWebService.geDialogCloseFlg.Yes,
                                      prm);
        }
        public void AddEvidence(string random, string pgId, int type, string memo)
        {
            #region 認証処理

            string companyId     = "";
            string groupId       = "";
            string userId        = "";
            string ipAdress      = "";
            string sessionString = "";
            try
            {
                companyId     = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]);
                groupId       = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]);
                userId        = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
                ipAdress      = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]);
                sessionString = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]);

                string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]));
                if (_message != "")
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".AddEvidence(認証処理)", ex);
                return;
            }

            #endregion

            gAddEvidence(1, companyId, userId, ipAdress, sessionString, pgId, (DataPgEvidence.geOperationType)type, memo);
        }
        private void InitDataSet()
        {
            try
            {
                if (this.ProcKbn == eProcKbn.Update)
                {
                    if (this.IsGetCompanyGroupList == true && this.IsGetPersonList == true)
                    {
                        this.txtTitle.Text = this._entity._title;

                        if (this._entity._gropu_id == 0)
                        {
                            cmbGroup.SelectedIndex = 0;
                        }
                        else
                        {
                            for (int i = 0; i <= cmbGroup.Items.Count - 1; i++)
                            {
                                if (ExCast.zCStr(this.cmbGroup.Items[i].ToString()) == this._entity._gropu_nm)
                                {
                                    cmbGroup.SelectedIndex = i;
                                }
                            }
                        }
                        for (int i = 0; i <= cmbPerson.Items.Count - 1; i++)
                        {
                            if (ExCast.zCStr(this.cmbPerson.Items[i].ToString()) == this._entity._person_nm)
                            {
                                cmbPerson.SelectedIndex = i;
                            }
                        }
                        for (int i = 0; i <= cmbLevel.Items.Count - 1; i++)
                        {
                            if (ExCast.zCStr(this.cmbLevel.Items[i].ToString()) == this._entity._duties_level_nm)
                            {
                                cmbLevel.SelectedIndex = i;
                            }
                        }
                        for (int i = 0; i <= cmbState.Items.Count - 1; i++)
                        {
                            if (ExCast.zCStr(this.cmbState.Items[i].ToString()) == this._entity._duties_state_nm)
                            {
                                cmbState.SelectedIndex = i;
                            }
                        }
                        this.txtPath.Text    = this._entity._upload_file_name1;
                        this.txtContent.Text = this._entity._content;

                        ExBackgroundWorker.DoWork_Focus(this.txtTitle, 100);
                    }
                }
            }
            catch (Exception ex)
            {
                ExMessageBox.Show(CLASS_NM + ".InitDataSet 初期データの設定に失敗しました。" + Environment.NewLine + ex.ToString(), "エラー確認");
                this.DialogResult = false;
            }
        }
        public override void DataSelect(int intKbn, object objList)
        {
            switch ((ExWebService.geWebServiceCallKbn)intKbn)
            {
            case _GetWebServiceCallKbn:
                if (objList != null)
                {
                    _entity = (ObservableCollection <EntityAuthority>)objList;
                    if (_entity.Count == 0)
                    {
                        return;
                    }

                    if (_entity[0]._lock_flg == 0)
                    {
                        this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Upd;
                    }
                    else
                    {
                        this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Sel;
                    }
                    this.cmbUser.IsEnabled = false;

                    IsEnabledCheck(true);
                    InitCheck();

                    // チェックセット
                    for (int i = 0; i <= this._entity.Count - 1; i++)
                    {
                        foreach (CheckBox chk in ExVisualTreeHelper.FindVisualChildren <CheckBox>(this.stpAll))
                        {
                            if (ExCast.zCStr(chk.Tag) == _entity[i]._pg_id)
                            {
                                if (_entity[i]._authority_kbn == 0)
                                {
                                    chk.IsChecked = false;
                                }
                                else
                                {
                                    chk.IsChecked = true;
                                }
                            }
                            else if (_entity[i]._pg_id == "EstimateInp" && ExCast.zCStr(chk.Tag) == "EstimateApproval" && _entity[i]._authority_kbn >= 3)
                            {
                                chk.IsChecked = true;
                            }
                        }
                    }
                }

                break;

            default:
                break;
            }
        }
        public static Control SearchControlForTag(DependencyObject RootObj, string tag)
        {
            foreach (Control ctl in GetChildren <Control>(RootObj, true))
            {
                if (ExCast.zCStr(ctl.Tag).IndexOf(tag) != -1)
                {
                    return(ctl);
                }
            }

            return(null);
        }
        public void LockPg(string random, string pgId, string lockId, int type)
        {
            #region 認証処理

            string companyId     = "";
            string groupId       = "";
            string userId        = "";
            string ipAdress      = "";
            string sessionString = "";
            try
            {
                companyId     = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]);
                groupId       = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]);
                userId        = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
                ipAdress      = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]);
                sessionString = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]);

                string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]));
                if (_message != "")
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".UnLockPg(認証処理)", ex);
                return;
            }

            #endregion

            try
            {
                ExMySQLData          db = ExSession.GetSessionDb(ExCast.zCInt(userId), sessionString);
                DataPgLock.geLovkFlg lockFlg;

                if (type == 0)
                {
                    DataPgLock.DelLockPg(companyId, userId, pgId, lockId, ipAdress, true, db);
                }
                else
                {
                    DataPgLock.SetLockPg(companyId, userId, pgId, lockId, ipAdress, db, out lockFlg);
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".UnLockPg", ex);
                return;
            }
        }
        private void ExChildWindow_Loaded(object sender, RoutedEventArgs e)
        {
            // 画面初期化
            ExVisualTreeHelper.initDisplay(this.LayoutRoot);

            EntityUnitPriceSetting _entity = null;

            switch (this.kbn)
            {
            case eKbn.Sales:
                _entity = new EntityUnitPriceSetting();
                _entity.unit_kind_nm = "上代";
                _entity.unit_price   = this.retail_price;
                _lstUnit.Add(_entity);
                _entity = new EntityUnitPriceSetting();
                _entity.unit_kind_nm = "売上単価";
                _entity.unit_price   = this.sales_unit_price;
                _lstUnit.Add(_entity);
                _entity = new EntityUnitPriceSetting();
                _entity.unit_kind_nm = "売上原価";
                _entity.unit_price   = this.sales_cost_price;
                _lstUnit.Add(_entity);
                break;

            case eKbn.Purchase:
                _entity = new EntityUnitPriceSetting();
                _entity.unit_kind_nm = "上代";
                _entity.unit_price   = this.retail_price;
                _lstUnit.Add(_entity);
                _entity = new EntityUnitPriceSetting();
                _entity.unit_kind_nm = "仕入単価";
                _entity.unit_price   = this.sales_unit_price;
                _lstUnit.Add(_entity);
                _entity = new EntityUnitPriceSetting();
                _entity.unit_kind_nm = "売上原価";
                _entity.unit_price   = this.sales_cost_price;
                _lstUnit.Add(_entity);
                break;
            }
            this.dg.ItemsSource   = _lstUnit;
            this.dg.SelectedIndex = 0;

            this.numUpCreditRate.SetValue(this.credit_rate);
            //this.numUpCreditRate.Value = this.credit_rate;

            this.txtUnitPrice.Text = ExCast.zCStr(ExMath.zFloor(this.retail_price * ExCast.zCInt(this.numUpCreditRate.Value) / 100, this.unit_decimal_digit));
            this.txtUnitPrice.OnFormatString();
        }
Exemple #12
0
        private void txt_GotFocus(object sender, RoutedEventArgs e)
        {
            GetUserControlFKey().SetFunctionKeyEnable("F5", false);
            activeControl = (Control)sender;
            beforeValue   = "";
            SetControl();

            if ((_entityListD.Count > DataForm.CurrentIndex && DataForm.CurrentIndex != -1) == false)
            {
                return;
            }

            switch (activeControl.Name)
            {
            case "txtReceiptDivisionId":
            case "txtBillSiteDay":
                GetUserControlFKey().SetFunctionKeyEnable("F5", true);
                break;

            default:
                GetUserControlFKey().SetFunctionKeyEnable("F5", false);
                break;
            }

            beforeSelectedIndex = DataForm.CurrentIndex;

            switch (activeControl.Name)
            {
            case "txtNo":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._rec_no); break;

            case "txtReceiptDivisionId":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._receipt_division_id); break;

            case "txtReceiptDivisionNm":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._receipt_division_nm); break;

            case "txtBillSiteDay":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._bill_site_day); break;

            case "txtPrice":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._price); break;

            case "txtDetailMemo":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._memo); break;
            }
        }
        private void btnInventory_Click(object sender, RoutedEventArgs e)
        {
            if (ExCast.zCStr(utlID.txtID.Text.Trim()) != "")
            {
            }
            else
            {
                ExMessageBox.Show("商品を選択して下さい。");
                return;
            }

            Dlg_MstSearch searchDlg = new Dlg_MstSearch(MstData.geMDataKbn.Inventory);

            searchDlg.MstKbn       = Class.Data.MstData.geMDataKbn.Inventory;
            searchDlg.MstGroupKbn  = Class.Data.MstData.geMGroupKbn.None;
            searchDlg.txtCode.Text = ExCast.zNumZeroNothingFormat(ExCast.zCStr(utlID.txtID.Text.Trim()));
            searchDlg.Show();
        }
Exemple #14
0
        // セッション保持DB情報の取得
        public static ExMySQLData GetSessionDb(int userId, string randomString)
        {
            for (int i = 0; i <= sessionInf.Count - 1; i++)
            {
                // 別の端末で同一ユーザー名でログインしていないかチェック
                if (sessionInf[i].userId == userId && sessionInf[i].randomString == randomString)
                {
                    return(sessionInf[i].db);
                }

                if (CommonUtl.gDemoKbn == 1)
                {
                    return(new ExMySQLData(ExCast.zCStr(HttpContext.Current.Session[ExSession.DB_CONNECTION_STR])));
                }
            }

            return(null);
        }
Exemple #15
0
        private void searchDlg_Closed(object sender, EventArgs e)
        {
            Dlg_Copying dlg = (Dlg_Copying)sender;

            if (dlg.utlCopying.DialogResult == true)
            {
                // ロック解除
                DataPgLock.gLockPg(PG_NM, ExCast.zCStr(_entity._id), (int)DataPgLock.geLockType.UnLock);

                if (dlg.utlCopying.copy_id == "")
                {
                    this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Init;
                    this.utlID.txtID_IsReadOnly            = false;
                    this.utlID.txtID.Text = "";
                }
                else
                {
                    if (dlg.utlCopying.ExistsData == true)
                    {
                        this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Upd;
                    }
                    else
                    {
                        this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.New;
                    }
                    string _id = dlg.utlCopying.copy_id;
                    if (ExCast.IsNumeric(dlg.utlCopying.copy_id))
                    {
                        _id                   = ExCast.zCDbl(_id).ToString();
                        _entity._id           = ExCast.zCInt(_id);
                        this.utlID.txtID.Text = _id;
                        this.utlID.txtID.FormatToID();
                    }
                    else
                    {
                        _entity._id           = ExCast.zCInt(_id);
                        this.utlID.txtID.Text = _id;
                    }

                    this.utlID.txtID_IsReadOnly = true;
                    ExBackgroundWorker.DoWork_Focus(this.txtName, 10);
                }
            }
        }
Exemple #16
0
        private void unitPriceDlg_Closed(object sender, EventArgs e)
        {
            Dlg_UnitPriceSetting unitPriceDlg = (Dlg_UnitPriceSetting)sender;

            if (unitPriceDlg.DialogResult == true)
            {
                if (_entityListD.Count > DataForm.CurrentIndex && DataForm.CurrentIndex != -1)
                {
                    _entityListD[DataForm.CurrentIndex]._unit_price = unitPriceDlg.return_unit_price;
                }
            }
            if (beforeValue != ExCast.zCStr(_entityListD[DataForm.CurrentIndex]._unit_price))
            {
                DataDetail.CalcDetail(DataForm.CurrentIndex, _entityH, _entityListD);
                this.Focus();
                _txtUnitPrice.Focus();
                _txtUnitPrice = null;
            }
        }
Exemple #17
0
            private static void logOut(string log, Exception ex)
            {
                string _companyId = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]);
                string _userId    = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
                string _now       = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss").Replace("i", "");

                try
                {
                    using (FileStream fileStream = new FileStream(@"F:\sitesroot\0\log\AppLog.txt", FileMode.Append))
                        using (Stream streamSync = Stream.Synchronized(fileStream))
                            using (BinaryWriter writer = new BinaryWriter(streamSync))
                            {
                                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                                sb.Append(_now + " >>>>>>>> log start " + " [COMPANY ID : " + _companyId + "] [USER ID : " + _userId + "] -------------------- " + Environment.NewLine);
                                sb.Append(_now + " >>>>>>>> " + log + Environment.NewLine);
                                if (ex != null)
                                {
                                    sb.Append(_now + " >>>>>>>> " + "--------------- Exception Message --------------------" + Environment.NewLine +
                                              _now + " >>>>>>>> " + ex.Message + Environment.NewLine);
                                    sb.Append(_now + " >>>>>>>> " + "--------------- Exception HelpLink -------------------" + Environment.NewLine +
                                              _now + " >>>>>>>> " + ex.HelpLink + Environment.NewLine);
                                    sb.Append(_now + " >>>>>>>> " + "--------------- Exception Source ---------------------" + Environment.NewLine +
                                              _now + " >>>>>>>> " + ex.Source + Environment.NewLine);
                                    sb.Append(_now + " >>>>>>>> " + "--------------- Exception StackTrace -----------------" + Environment.NewLine +
                                              _now + " >>>>>>>> " + ex.StackTrace + Environment.NewLine);
                                    sb.Append(_now + " >>>>>>>> " + "--------------- Exception TargetSite -----------------" + Environment.NewLine +
                                              _now + " >>>>>>>> " + ex.TargetSite + Environment.NewLine);
                                    sb.Append(_now + " >>>>>>>> " + "------------------------------------------------------" + Environment.NewLine);
                                }
                                sb.Append(_now + " >>>>>>>> log end   " + " [COMPANY ID : " + _companyId + "] [USER ID : " + _userId + "] -------------------- " + Environment.NewLine + Environment.NewLine);

                                byte[] bytesData = System.Text.Encoding.GetEncoding("shift_jis").GetBytes(sb.ToString());
                                writer.Write(bytesData);
                                writer.Flush();
                            }
                }
                catch (Exception e)
                {
                    Debug.Print(ex.Message.ToString());
                }
            }
        private void GetMstData()
        {
            object[] prm = new object[2];

            int id = 0;

            for (int i = 0; i <= this._entityUserList.Count - 1; i++)
            {
                if (ExCast.zCStr(this.cmbUser.SelectedValue) == _entityUserList[i].name)
                {
                    id = ExCast.zCInt(_entityUserList[i].attribute1);
                }
            }
            prm[0] = id;

            webService.objPerent = this;
            webService.CallWebService(_GetWebServiceCallKbn,
                                      ExWebService.geDialogDisplayFlg.Yes,
                                      ExWebService.geDialogCloseFlg.Yes,
                                      prm);
        }
        // データ追加・更新・削除
        private void UpdateData(Common.geUpdateType upd)
        {
            object[] prm = new object[3];
            prm[0] = (int)upd;
            prm[1] = 0;

            _entityUpdate._title = this.txtTitle.Text;

            for (int i = 0; i <= _entityPersonList.Count - 1; i++)
            {
                if (ExCast.zCStr(this.cmbPerson.SelectedValue) == _entityPersonList[i].name)
                {
                    _entityUpdate._person_id   = ExCast.zCInt(_entityPersonList[i].id);
                    _entityUpdate._d_person_id = ExCast.zCInt(_entityPersonList[i].id);
                }
            }

            if (this.cmbKbn.SelectedValue != null)
            {
                _entityUpdate._inquiry_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.INQUIRY_DIVISION_ID, ExCast.zCStr(this.cmbKbn.SelectedValue));
            }

            if (this.cmbLevel.SelectedValue != null)
            {
                _entityUpdate._inquiry_level_id = MeiNameList.GetID(MeiNameList.geNameKbn.LEVEL_ID, ExCast.zCStr(this.cmbLevel.SelectedValue));
            }

            _entityUpdate._inquiry_level_state_id = 1;    // オープン
            _entityUpdate._title   = this.txtTitle.Text;
            _entityUpdate._content = this.txtContent.Text;
            _entityUpdate._rec_no  = 1;
            _entityUpdate._kbn     = 0;   // ユーザー

            prm[2] = _entityUpdate;
            webService.objWindow = this;
            webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdateInquiry,
                                      ExWebService.geDialogDisplayFlg.Yes,
                                      ExWebService.geDialogCloseFlg.Yes,
                                      prm);
        }
        private void Init()
        {
            GetPersonList();

            txtTitle.Text = _entityList[0]._title;
            txtNo.Text    = ExCast.zCStr(_entityList[0]._no);
            txtKbn.Text   = _entityList[0]._inquiry_division_nm;
            txtLevel.Text = _entityList[0]._inquiry_level_nm;
            txtState.Text = _entityList[0]._inquiry_level_state_nm;

            for (int i = 0; i <= _entityList.Count - 1; i++)
            {
                TextBox txt = new TextBox();
                txt.IsReadOnly    = true;
                txt.AcceptsReturn = true;
                txt.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
                txt.Text += _entityList[i]._d_date_time + Environment.NewLine;
                if (_entityList[i]._kbn == 0)
                {
                    // ユーザー時
                    txt.Text      += _entityList[i]._d_person_nm + " 様" + Environment.NewLine;
                    txt.Background = new SolidColorBrush(Colors.White);
                }
                else
                {
                    // サポート時
                    txt.Text      += _entityList[i]._support_person_nm + Environment.NewLine;
                    txt.Background = new SolidColorBrush(Colors.LightGray);
                }
                txt.Text += "---------------------------------------------------------------------------------------------------------------------" + Environment.NewLine;
                txt.Text += _entityList[i]._content + Environment.NewLine;
                this.stpHistory.Children.Add(txt);

                TextBlock tbk = new TextBlock();
                tbk.Height = 5;
                this.stpHistory.Children.Add(tbk);
            }
        }
Exemple #21
0
        private void GetMstData()
        {
            object[] prm = new object[1];

            prm[0] = "";
            for (int i = 0; i <= _entityUserList.Count - 1; i++)
            {
                if (ExCast.zCStr(this.cmbLoginId.SelectedValue) == _entityUserList[i].id)
                {
                    prm[0] = ExCast.zCInt(_entityUserList[i].attribute1);
                }
            }
            if (ExCast.zCStr(prm[0]) == "")
            {
                return;
            }

            webService.objPerent = this;
            webService.CallWebService(_GetWebServiceCallKbn,
                                      ExWebService.geDialogDisplayFlg.Yes,
                                      ExWebService.geDialogCloseFlg.Yes,
                                      prm);
        }
Exemple #22
0
        private void txt_LostFocus(object sender, RoutedEventArgs e)
        {
            Control      ctl = (Control)sender;
            ExTextBox    txt = null;
            ExDatePicker dap = null;
            ComboBox     cmb = null;
            int          i   = beforeSelectedIndex;

            switch (ctl.Name)
            {
            case "txtReceiptDivisionId":
                txt = (ExTextBox)sender;
                if (beforeValue == ExCast.zCStr(txt.Text))
                {
                    return;
                }
                MstData _mstData = new MstData();
                _mstData.GetMData(MstData.geMDataKbn.RecieptDivision, new string[] { ExCast.zCStr(txt.Text), ExCast.zCStr(i) }, this);
                break;

            default:
                break;
            }
        }
        // データ追加・更新・削除
        private void UpdateData(Common.geUpdateType upd)
        {
            object[] prm = new object[3];
            prm[0] = (int)upd;
            prm[1] = _entityList[0]._no;

            _entityUpdate._no                     = _entityList[0]._no;
            _entityUpdate._company_id             = _entityList[0]._company_id;
            _entityUpdate._gropu_id               = _entityList[0]._gropu_id;
            _entityUpdate._person_id              = _entityList[0]._person_id;
            _entityUpdate._date_time              = _entityList[0]._date_time;
            _entityUpdate._title                  = _entityList[0]._title;
            _entityUpdate._inquiry_division_id    = _entityList[0]._inquiry_division_id;
            _entityUpdate._inquiry_level_id       = _entityList[0]._inquiry_level_id;
            _entityUpdate._inquiry_level_state_id = 2; // 回答待ち
            _entityUpdate._rec_no                 = _entityList[0]._rec_no + 1;
            _entityUpdate._kbn                    = 0; // ユーザー
            _entityUpdate._title                  = this.txtTitle.Text;
            _entityUpdate._content                = this.txtContent.Text;

            for (int i = 0; i <= _entityPersonList.Count - 1; i++)
            {
                if (ExCast.zCStr(this.cmbPerson.SelectedValue) == _entityPersonList[i].name)
                {
                    _entityUpdate._d_person_id = ExCast.zCInt(_entityPersonList[i].id);
                }
            }


            prm[2] = _entityUpdate;
            webService.objWindow = this;
            webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdateInquiry,
                                      ExWebService.geDialogDisplayFlg.Yes,
                                      ExWebService.geDialogCloseFlg.Yes,
                                      prm);
        }
Exemple #24
0
        // 入力チェック(更新時)
        public override void InputCheckUpdate()
        {
            #region Field

            string  errMessage  = "";
            string  warnMessage = "";
            Control errCtl      = null;

            #endregion

            try
            {
                for (int i = 0; i <= _entity.Count - 1; i++)
                {
                    // IDまたは名称の入力がある場合(空行は無視)
                    if (!string.IsNullOrEmpty(_entity[i]._id) || !string.IsNullOrEmpty(_entity[i]._name))
                    {
                        #region 入力チェック

                        #region 必須チェック

                        // ID
                        if (string.IsNullOrEmpty(_entity[i]._id))
                        {
                            errMessage += (i + 1) + "行目のIDが入力されていません。" + Environment.NewLine;
                            if (errCtl == null)
                            {
                                errCtl        = this.dg;
                                _selectIndex  = i;
                                _selectColumn = 0;
                            }
                        }

                        // 名称
                        if (string.IsNullOrEmpty(_entity[i]._name))
                        {
                            errMessage += (i + 1) + "行目の名称が入力されていません。" + Environment.NewLine;
                            if (errCtl == null)
                            {
                                errCtl        = this.dg;
                                _selectIndex  = i;
                                _selectColumn = 1;
                            }
                        }

                        #endregion

                        #region 適正値入力チェック

                        if (!string.IsNullOrEmpty(_entity[i]._id))
                        {
                            if (ExCast.zCInt(_entity[i]._id) == 0)
                            {
                                errMessage += (i + 1) + "行目のIDに「0」以外を入力して下さい。" + Environment.NewLine;
                                if (errCtl == null)
                                {
                                    errCtl        = this.dg;
                                    _selectIndex  = i;
                                    _selectColumn = 0;
                                }
                            }
                        }

                        //// 主仕入先
                        //if (ExCast.zCStr(_entity._main_purchase_id) != "" && string.IsNullOrEmpty(_entity._main_purchase_nm))
                        //{
                        //    errMessage += "主仕入先が適切に入力(選択)されていません。" + Environment.NewLine;
                        //    if (errCtl == null) errCtl = this.utlMainPurchaseId.txtID;
                        //}

                        #endregion

                        #region  一IDチェック

                        if (!string.IsNullOrEmpty(_entity[i]._id))
                        {
                            for (int _i = 0; _i <= _entity.Count - 1; _i++)
                            {
                                if (_i != i && ExCast.zCInt(_entity[i]._id) == ExCast.zCInt(_entity[_i]._id) && !string.IsNullOrEmpty(_entity[_i]._id) && ExCast.zCInt(_entity[i]._id) != 0)
                                {
                                    string _msg = "ID : " + ExCast.zCInt(_entity[i]._id) + " が重複して入力されています。" + Environment.NewLine;
                                    if (errMessage.IndexOf(_msg) == -1)
                                    {
                                        errMessage += _msg;
                                        if (errCtl == null)
                                        {
                                            errCtl        = this.dg;
                                            _selectIndex  = i;
                                            _selectColumn = 0;
                                        }
                                    }
                                }
                            }
                        }

                        #endregion

                        #region 日付チェック

                        //// 納入指定日
                        //if (string.IsNullOrEmpty(_entity.supply_ymd) == false)
                        //{
                        //    if (ExCast.IsDate(_entity.supply_ymd) == false)
                        //    {
                        //        errMessage += "納入指定日の形式が不正です。(yyyy/mm/dd形式で入力(選択)して下さい)" + Environment.NewLine;
                        //        if (errCtl == null) errCtl = this.datNokiYmd;
                        //    }
                        //}

                        #endregion

                        #region 日付変換

                        // 受注日
                        //if (string.IsNullOrEmpty(_entity.order_ymd) == false)
                        //{
                        //    _entity.order_ymd = ExCast.zConvertToDate(_entity.order_ymd).ToString("yyyy/MM/dd");

                        //}

                        #endregion

                        #region 数値チェック

                        // ID
                        if (!string.IsNullOrEmpty(_entity[i]._id))
                        {
                            if (!ExCast.IsNumeric(_entity[i]._id))
                            {
                                errMessage += (i + 1) + "行目のIDに数値が入力されていません。" + Environment.NewLine;
                                if (errCtl == null)
                                {
                                    errCtl        = this.dg;
                                    _selectIndex  = i;
                                    _selectColumn = 0;
                                }
                            }
                        }

                        #endregion

                        #region 正数チェック

                        //if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                        //{
                        //    if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) < 0)
                        //    {
                        //        errMessage += "IDには正の整数を入力して下さい。" + Environment.NewLine;
                        //    }
                        //}

                        #endregion

                        #region 範囲チェック

                        //if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) > 9999)
                        //{
                        //    errMessage += "IDには4桁の正の整数を入力して下さい。" + Environment.NewLine;
                        //}

                        //if (ExString.LenB(_entity._memo) > 32)
                        //{
                        //    errMessage += "備考には全角16桁文字以内(半角32桁文字以内)を入力して下さい。" + Environment.NewLine;
                        //    if (errCtl == null) errCtl = this.txtMemo;
                        //}

                        #endregion

                        #endregion

                        _entity[i]._display_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.DISPLAY_DIVISION_ID, ExCast.zCStr(_entity[i]._display_division_nm)) - 1;
                    }
                }

                #region エラー or 警告時処理

                bool flg = true;

                if (!string.IsNullOrEmpty(errMessage))
                {
                    ExMessageBox.Show(this, errCtl, errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                    flg = false;
                }

                if (!string.IsNullOrEmpty(warnMessage))
                {
                    warnMessage += "このまま登録を続行してもよろしいですか?" + Environment.NewLine;
                    ExMessageBox.ResultShow(this, errCtl, warnMessage);
                    flg = false;
                    //if (ExMessageBox.ResultShow(warnMessage) == MessageBoxResult.No)
                    //{
                    //    flg = false;
                    //}
                }

                this.txtDummy.IsTabStop = false;

                if (flg == false)
                {
                    if (errCtl != null)
                    {
                        switch (errCtl.Name)
                        {
                        case "dg":
                            errCtl.Focus();
                            this.dg.SelectedIndex = _selectIndex;
                            dg.CurrentColumn      = dg.Columns[_selectColumn];
                            ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                            break;

                        default:
                            ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                            break;
                        }
                    }
                    return;
                }

                #endregion

                #region 更新処理

                UpdateData();

                #endregion
            }
            finally
            {
                Common.gblnBtnProcLock          = false;
                Common.gblnBtnDesynchronizeLock = false;
            }
        }
Exemple #25
0
        private void dg_CellEditEnded(object sender, DataGridCellEditEndedEventArgs e)
        {
            EntityCondition entity = (EntityCondition)e.Row.DataContext;

            // コンボボックスID連動
            switch (e.Column.DisplayIndex)
            {
            case 2:             // 表示区分
                if (_entity == null)
                {
                    return;
                }
                if (_entity.Count >= dg.SelectedIndex && dg.SelectedIndex != -1)
                {
                    _entity[dg.SelectedIndex]._display_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.DISPLAY_DIVISION_ID, ExCast.zCStr(entity._display_division_nm)) - 1;
                }
                break;
            }
        }
        public List <EntityStockInventory> GetStockInventoryList(string random, string strWhereSql, string strOrderBySql)
        {
            List <EntityStockInventory> entityList = new List <EntityStockInventory>();

            #region 認証処理

            string companyId         = "";
            string groupId           = "";
            string userId            = "";
            string ipAdress          = "";
            string sessionString     = "";
            int    idFigureCommodity = 0;
            int    idFigureCustomer  = 0;
            int    idFigurePurchase  = 0;
            int    idFigureSlipNo    = 0;

            try
            {
                companyId         = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]);
                groupId           = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]);
                userId            = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
                ipAdress          = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]);
                sessionString     = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]);
                idFigureCommodity = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_GOODS]);
                idFigureCustomer  = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_CUSTOMER]);
                idFigurePurchase  = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_PURCHASE]);
                idFigureSlipNo    = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_SLIP_NO]);

                string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]));
                if (_message != "")
                {
                    EntityStockInventory entity = new EntityStockInventory();
                    entity.MESSAGE = _message;
                    entityList.Add(entity);
                    return(entityList);
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".GetStockInventoryList(認証処理)", ex);
                EntityStockInventory entity = new EntityStockInventory();
                entity.MESSAGE = "認証処理に失敗しました。" + Environment.NewLine + ex.Message.ToString();;
                entityList.Add(entity);
                return(entityList);
            }
            #endregion

            StringBuilder sb;
            DataTable     dt;
            ExMySQLData   db;

            try
            {
                db = ExSession.GetSessionDb(ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]),
                                            ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]));

                sb = new StringBuilder();

                ExReportManeger rptMgr = new ExReportManeger();
                rptMgr.idFigureCommodity = idFigureCommodity;
                rptMgr.idFigureCustomer  = idFigureCustomer;
                rptMgr.idFigurePurchase  = idFigurePurchase;
                rptMgr.idFigureSlipNo    = idFigureSlipNo;
                sb.Append(rptMgr.GetStockInventoryListReportSQL(companyId, groupId, strWhereSql, strOrderBySql));

                dt = db.GetDataTable(sb.ToString());

                if (dt.DefaultView.Count > 0)
                {
                    for (int i = 0; i <= dt.DefaultView.Count - 1; i++)
                    {
                        #region Set Entity

                        EntityStockInventory entity = new EntityStockInventory();
                        entity.commodity_id              = ExCast.zCStr(dt.DefaultView[i]["COMMODITY_ID"]);
                        entity.commodity_name            = ExCast.zCStr(dt.DefaultView[i]["COMMODITY_NAME"]);
                        entity.account_inventory_number  = ExCast.zCDbl(dt.DefaultView[i]["INVENTORY_NUMBER"]);
                        entity.practice_inventory_number = ExCast.zCDbl(dt.DefaultView[i]["INVENTORY_NUMBER"]);
                        entity.diff_number = 0;

                        entity.exec_flg = false;

                        entity.lock_flg = 0;

                        entityList.Add(entity);

                        #endregion
                    }
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".GetStockInventoryList", ex);
                entityList.Clear();
                EntityStockInventory entity = new EntityStockInventory();
                entity.MESSAGE = CLASS_NM + ".GetStockInventoryList : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message.ToString();
                entityList.Add(entity);
            }
            finally
            {
                db = null;
            }

            svcPgEvidence.gAddEvidence(ExCast.zCInt(HttpContext.Current.Session[ExSession.EVIDENCE_SAVE_FLG]),
                                       companyId,
                                       userId,
                                       ipAdress,
                                       sessionString,
                                       DataPgEvidence.PGName.StockInventory.StockInventoryInp,
                                       DataPgEvidence.geOperationType.Select,
                                       "Where:" + strWhereSql + ",Orderby:" + strOrderBySql);

            return(entityList);
        }
        public string UpdateStockInventory(string random, int type, string ymd, List <EntityStockInventory> entity)
        {
            #region 認証処理

            string companyId     = "";
            string groupId       = "";
            string userId        = "";
            string ipAdress      = "";
            string sessionString = "";
            string personId      = "";

            try
            {
                companyId     = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]);
                groupId       = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]);
                userId        = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
                ipAdress      = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]);
                sessionString = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]);
                personId      = ExCast.zCStr(HttpContext.Current.Session[ExSession.PERSON_ID]);

                string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]));
                if (_message != "")
                {
                    return(_message);
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".UpdateStockInventory(認証処理)", ex);
                return(CLASS_NM + ".UpdateStockInventory : 認証処理に失敗しました。" + Environment.NewLine + ex.Message.ToString());
            }

            #endregion

            #region Field

            StringBuilder sb = new StringBuilder();
            DataTable     dt;
            ExMySQLData   db        = null;
            string        _Id       = "";
            int           _classKbn = 0;

            long   rec_cnt     = 0;
            string str_message = "";

            EntityInOutDeliveryH        _entityInOutDeliveryH           = new EntityInOutDeliveryH();
            List <EntityInOutDeliveryD> _entityInOutDeliveryListD_Plus  = new List <EntityInOutDeliveryD>();
            List <EntityInOutDeliveryD> _entityInOutDeliveryListD_Minus = new List <EntityInOutDeliveryD>();

            #endregion

            #region Databese Open

            try
            {
                db = new ExMySQLData(ExCast.zCStr(HttpContext.Current.Session[ExSession.DB_CONNECTION_STR]));
                db.DbOpen();
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".UpdateStockInventory(DbOpen)", ex);
                return(CLASS_NM + ".UpdateStockInventory(DbOpen) : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message);
            }

            #endregion

            #region BeginTransaction

            try
            {
                db.ExBeginTransaction();
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".UpdateStockInventory(BeginTransaction)", ex);
                return(CLASS_NM + ".UpdateStockInventory(BeginTransaction) : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message);
            }

            #endregion

            #region Update

            if (type == 0)
            {
                try
                {
                    for (int i = 0; i <= entity.Count - 1; i++)
                    {
                        if (entity[i].exec_flg == true && entity[i].diff_number != 0)
                        {
                            #region Update Commodity Inventory

                            try
                            {
                                DataCommodityInventory.UpdCommodityInventory(companyId,
                                                                             groupId,
                                                                             db,
                                                                             ExCast.zNumZeroNothingFormat(entity[i].commodity_id),
                                                                             entity[i].diff_number * -1,
                                                                             PG_NM,
                                                                             ExCast.zCInt(personId),
                                                                             ipAdress,
                                                                             userId);
                            }
                            catch (Exception ex)
                            {
                                CommonUtl.ExLogger.Error(CLASS_NM + ".UpdateSales(Update Commodity Inventory)", ex);
                                return("UpdateSales(Update Commodity Inventory) : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message);
                            }

                            #endregion

                            #region Set Entity InOutDelivery

                            rec_cnt += 1;

                            EntityInOutDeliveryD _entityInOutDeliveryD = new EntityInOutDeliveryD();
                            _entityInOutDeliveryD.rec_no         = rec_cnt;
                            _entityInOutDeliveryD.commodity_id   = entity[i].commodity_id;
                            _entityInOutDeliveryD.commodity_name = entity[i].commodity_name;
                            _entityInOutDeliveryD.unit_id        = 0;
                            _entityInOutDeliveryD.enter_number   = 0;
                            _entityInOutDeliveryD.case_number    = 0;

                            if (entity[i].diff_number > 0)
                            {
                                _entityInOutDeliveryD.number = entity[i].diff_number;
                                _entityInOutDeliveryListD_Minus.Add(_entityInOutDeliveryD);
                            }
                            else
                            {
                                _entityInOutDeliveryD.number = entity[i].diff_number * -1;
                                _entityInOutDeliveryListD_Plus.Add(_entityInOutDeliveryD);
                            }

                            #endregion
                        }
                    }

                    #region Update InOutDelivery

                    try
                    {
                        svcInOutDelivery _svcInOutDelivery = new svcInOutDelivery();

                        if (_entityInOutDeliveryListD_Minus.Count > 0)
                        {
                            _entityInOutDeliveryH.in_out_delivery_ymd      = ymd;
                            _entityInOutDeliveryH.in_out_delivery_kbn      = 2;     // 入出庫区分:出庫
                            _entityInOutDeliveryH.in_out_delivery_proc_kbn = 4;     // 入出庫処理区分:棚卸
                            _entityInOutDeliveryH.in_out_delivery_to_kbn   = 1;     // 入出庫先区分:グループ
                            _entityInOutDeliveryH.update_person_id         = ExCast.zCInt(personId);
                            _entityInOutDeliveryH.group_id_to = groupId;

                            for (int i = 0; i <= _entityInOutDeliveryListD_Minus.Count - 1; i++)
                            {
                                _entityInOutDeliveryH.sum_enter_number += _entityInOutDeliveryListD_Minus[i].enter_number;
                                _entityInOutDeliveryH.sum_case_number  += _entityInOutDeliveryListD_Minus[i].case_number;
                                _entityInOutDeliveryH.sum_number       += _entityInOutDeliveryListD_Minus[i].number;
                            }

                            // random
                            // update type     1:Insert
                            // procKbn         4:棚卸
                            // InOutDeliveryNo 入出庫番号
                            // CauseNo         元伝票番号
                            str_message = _svcInOutDelivery.UpdateInOutDeliveryExcExc(random,
                                                                                      1,
                                                                                      4,
                                                                                      0,
                                                                                      0,
                                                                                      _entityInOutDeliveryH,
                                                                                      _entityInOutDeliveryListD_Minus,
                                                                                      null,
                                                                                      null);
                            if (str_message.IndexOf("Auto Insert success : ") == -1 && !string.IsNullOrEmpty(str_message))
                            {
                                return("UpdateStockInventory(Update InOutDelivery) : " + str_message);
                            }
                        }

                        _svcInOutDelivery = new svcInOutDelivery();

                        _entityInOutDeliveryH = null;
                        _entityInOutDeliveryH = new EntityInOutDeliveryH();
                        if (_entityInOutDeliveryListD_Plus.Count > 0)
                        {
                            _entityInOutDeliveryH.in_out_delivery_ymd      = ymd;
                            _entityInOutDeliveryH.in_out_delivery_kbn      = 1;     // 入出庫区分:入庫
                            _entityInOutDeliveryH.in_out_delivery_proc_kbn = 4;     // 入出庫処理区分:棚卸
                            _entityInOutDeliveryH.in_out_delivery_to_kbn   = 1;     // 入出庫先区分:グループ
                            _entityInOutDeliveryH.update_person_id         = ExCast.zCInt(personId);
                            _entityInOutDeliveryH.group_id_to = groupId;

                            for (int i = 0; i <= _entityInOutDeliveryListD_Plus.Count - 1; i++)
                            {
                                _entityInOutDeliveryH.sum_enter_number += _entityInOutDeliveryListD_Plus[i].enter_number;
                                _entityInOutDeliveryH.sum_case_number  += _entityInOutDeliveryListD_Plus[i].case_number;
                                _entityInOutDeliveryH.sum_number       += _entityInOutDeliveryListD_Plus[i].number;
                            }

                            // random
                            // update type     1:Insert
                            // procKbn         4:棚卸
                            // InOutDeliveryNo 入出庫番号
                            // CauseNo         元伝票番号
                            str_message = _svcInOutDelivery.UpdateInOutDeliveryExcExc(random,
                                                                                      1,
                                                                                      4,
                                                                                      0,
                                                                                      0,
                                                                                      _entityInOutDeliveryH,
                                                                                      _entityInOutDeliveryListD_Plus,
                                                                                      null,
                                                                                      null);
                            if (str_message.IndexOf("Auto Insert success : ") == -1 && !string.IsNullOrEmpty(str_message))
                            {
                                return("UpdateStockInventory(Update InOutDelivery) : " + str_message);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        db.ExRollbackTransaction();
                        CommonUtl.ExLogger.Error(CLASS_NM + ".UpdateStockInventory(Update InOutDelivery)", ex);
                        return("UpdateStockInventory(Update InOutDelivery) : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message);
                    }

                    #endregion
                }
                catch (Exception ex)
                {
                    db.ExRollbackTransaction();
                    CommonUtl.ExLogger.Error(CLASS_NM + ".UpdateStockInventory(Insert)", ex);
                    return(CLASS_NM + ".UpdateStockInventory(Insert) : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message);
                }
            }

            #endregion

            #region PG排他制御

            //try
            //{
            //    DataPgLock.DelLockPg(companyId, userId, PG_NM, "", ipAdress, false, db);
            //}
            //catch (Exception ex)
            //{
            //    db.ExRollbackTransaction();
            //    CommonUtl.ExLogger.Error(CLASS_NM + ".UpdateStockInventory(DelLockPg)", ex);
            //    return CLASS_NM + ".UpdateStockInventory(DelLockPg) : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message;
            //}

            #endregion

            #region CommitTransaction

            try
            {
                db.ExCommitTransaction();
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".UpdateStockInventory(CommitTransaction)", ex);
                return(CLASS_NM + ".UpdateStockInventory(CommitTransaction) : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message);
            }

            #endregion

            #region Database Close

            try
            {
                db.DbClose();
            }
            catch (Exception ex)
            {
                db.ExRollbackTransaction();
                CommonUtl.ExLogger.Error(CLASS_NM + ".UpdateStockInventory(DbClose)", ex);
                return(CLASS_NM + ".UpdateStockInventory(DbClose) : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message);
            }
            finally
            {
                db = null;
            }

            #endregion

            #region Add Evidence

            try
            {
                svcPgEvidence.gAddEvidence(ExCast.zCInt(HttpContext.Current.Session[ExSession.EVIDENCE_SAVE_FLG]),
                                           companyId,
                                           userId,
                                           ipAdress,
                                           sessionString,
                                           PG_NM,
                                           DataPgEvidence.geOperationType.DeleteAndInsert,
                                           "");
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".UpdateStockInventory(Add Evidence)", ex);
                return(CLASS_NM + ".UpdateStockInventory(Add Evidence) : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message);
            }

            #endregion

            return("");
        }
        private void GetMstList(ExWebService.geDialogDisplayFlg flg)
        {
            object[] prm = new object[4];
            prm[0] = this.txtCode.Text.Trim();
            prm[1] = this.txtName.Text.Trim();

            if (this.stpKana.Visibility == System.Windows.Visibility.Visible)
            {
                prm[2] = this.txtKana.Text.Trim();
            }
            else
            {
                prm[2] = "";
            }

            prm[3] = "";
            if (objClassList != null)
            {
                for (int i = 0; i <= objClassList.Count - 1; i++)
                {
                    if (ExCast.zCStr(this.cmbGroup1.SelectedValue) == objClassList[i].name)
                    {
                        prm[3] = objClassList[i].id;
                    }
                }
            }

            if (this.MstKbn == MstData.geMDataKbn.Supplier)
            {
                prm[4] = ExCast.zNumZeroNothingFormat(Dlg_MstSearchGroup.this_id2);
            }
            webServiceMst.objPerent = this.utlDummy;

            ExWebServiceMst.geWebServiceMstNmCallKbn callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetCustomerList;
            switch (this.MstKbn)
            {
            case MstData.geMDataKbn.Customer:
            case MstData.geMDataKbn.Customer_F:
            case MstData.geMDataKbn.Customer_T:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetCustomerList;
                break;

            case MstData.geMDataKbn.Supplier:
            case MstData.geMDataKbn.Supplier_F:
            case MstData.geMDataKbn.Supplier_T:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetSupplierList;
                break;

            case MstData.geMDataKbn.Person:
            case MstData.geMDataKbn.Person_F:
            case MstData.geMDataKbn.Person_T:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetPersonList;
                break;

            case MstData.geMDataKbn.Commodity:
            case MstData.geMDataKbn.Commodity_F:
            case MstData.geMDataKbn.Commodity_T:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetCommodityList;
                break;

            case MstData.geMDataKbn.CompanyGroup:
            case MstData.geMDataKbn.CompanyGroup_F:
            case MstData.geMDataKbn.CompanyGroup_T:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetCompanyGroupList;
                break;

            case MstData.geMDataKbn.Zip:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetZipList;
                break;

            case MstData.geMDataKbn.Condition:
            case MstData.geMDataKbn.Condition_F:
            case MstData.geMDataKbn.Condition_T:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetConditionList;
                break;

            case MstData.geMDataKbn.RecieptDivision:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetRecieptDivisionList;
                break;

            case MstData.geMDataKbn.Group:
            case MstData.geMDataKbn.Group_F:
            case MstData.geMDataKbn.Group_T:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetGroupList;
                webServiceMst.MstGroupKbn = this.MstGroupKbn;
                break;

            case MstData.geMDataKbn.Purchase:
            case MstData.geMDataKbn.Purchase_F:
            case MstData.geMDataKbn.Purchase_T:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetPurchaseList;
                webServiceMst.MstGroupKbn = this.MstGroupKbn;
                break;

            case MstData.geMDataKbn.Inventory:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetInventoryList;
                webServiceMst.MstGroupKbn = this.MstGroupKbn;
                break;

            case MstData.geMDataKbn.SalesBalance:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetSalesBalanceList;
                webServiceMst.MstGroupKbn = this.MstGroupKbn;
                break;

            case MstData.geMDataKbn.PaymentBalance:
                callKbn = ExWebServiceMst.geWebServiceMstNmCallKbn.GetPaymentBalanceList;
                webServiceMst.MstGroupKbn = this.MstGroupKbn;
                break;
            }

            if (flg == ExWebService.geDialogDisplayFlg.Yes)
            {
                webServiceMst.CallWebServiceMst(callKbn,
                                                ExWebService.geDialogDisplayFlg.Yes,
                                                ExWebService.geDialogCloseFlg.Yes,
                                                prm);
            }
            else
            {
                webServiceMst.CallWebServiceMst(callKbn,
                                                ExWebService.geDialogDisplayFlg.No,
                                                ExWebService.geDialogCloseFlg.No,
                                                prm);
            }
        }
Exemple #29
0
        private void txt_LostFocus(object sender, RoutedEventArgs e)
        {
            Control   ctl = (Control)sender;
            ExTextBox txt = null;
            ComboBox  cmb = null;
            int       i   = beforeSelectedIndex;

            switch (ctl.Name)
            {
            case "cmbBreakdown":
                cmb = (ComboBox)sender;
                if (_entityListD.Count > i && i != -1)
                {
                    // コンボボックスID連携
                    _entityListD[i]._breakdown_id = MeiNameList.GetID(MeiNameList.geNameKbn.BREAKDOWN_ID, ExCast.zCStr(cmb.SelectedValue));
                    // 消費税
                    if (_entityListD[i]._breakdown_id == 5)
                    {
                        _entityListD[i]._tax_division_nm = "非課税";
                        _entityListD[i]._tax_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.TAX_DIVISION_ID, ExCast.zCStr(_entityListD[i]._tax_division_nm));
                    }
                }
                break;

            case "txtGoodsId":
                txt = (ExTextBox)sender;
                if (beforeValue == ExCast.zCStr(txt.Text))
                {
                    return;
                }
                MstData _mstData = new MstData();
                _mstData.GetMData(MstData.geMDataKbn.Commodity, new string[] { ExCast.zCStr(txt.Text), ExCast.zCStr(i) }, this);
                break;

            case "cboUnit":
                cmb = (ComboBox)sender;
                if (_entityListD.Count > i && i != -1)
                {
                    // コンボボックスID連携
                    _entityListD[i]._unit_id = MeiNameList.GetID(MeiNameList.geNameKbn.UNIT_ID, ExCast.zCStr(cmb.SelectedValue));
                }
                break;

            case "txtEnterNum":
                // 明細入数計算
                txt = (ExTextBox)sender;
                if (_entityListD.Count > i && i != -1)
                {
                    if (beforeValue == ExCast.zCStr(txt.Text))
                    {
                        return;
                    }
                    _entityListD[i]._enter_number = ExCast.zCDbl(txt.Text);
                    DataDetail.CalcDetailNumber(i, _entityH, _entityListD);
                }
                break;

            case "txtCaseNum":
                // 明細ケース数計算
                txt = (ExTextBox)sender;
                if (_entityListD.Count > i && i != -1)
                {
                    if (beforeValue == ExCast.zCStr(txt.Text))
                    {
                        return;
                    }
                    _entityListD[i]._case_number = ExCast.zCDbl(txt.Text);
                    DataDetail.CalcDetailNumber(i, _entityH, _entityListD);
                }
                break;

            case "txtNumber":
                // 明細数量計算
                txt = (ExTextBox)sender;
                if (_entityListD.Count > i && i != -1)
                {
                    if (beforeValue == ExCast.zCStr(txt.Text))
                    {
                        return;
                    }
                    //OrderDetailData.CalcDetailNumber(i, _entityH, _entityListD);
                    _entityListD[i]._number = ExCast.zCDbl(txt.Text);
                    DataDetail.CalcDetail(i, _entityH, _entityListD);
                }
                break;

            case "txtUnitPrice":
                // 明細計算
                txt = (ExTextBox)sender;
                if (_entityListD.Count > i && i != -1)
                {
                    if (beforeValue == ExCast.zCStr(txt.Text))
                    {
                        return;
                    }
                    _entityListD[i]._unit_price = ExCast.zCDbl(txt.Text);
                    DataDetail.CalcDetail(i, _entityH, _entityListD);
                }
                break;

            case "txtPrice":
                // 明細計算
                txt = (ExTextBox)sender;
                if (_entityListD.Count > i && i != -1)
                {
                    if (beforeValue == ExCast.zCStr(txt.Text))
                    {
                        return;
                    }
                    _entityListD[i]._price = ExCast.zCDbl(txt.Text);
                    DataDetail.IsCalcPrice = false;
                    DataDetail.CalcDetail(i, _entityH, _entityListD);
                    DataDetail.IsCalcPrice = true;
                }
                break;

            case "cboTaxDivision":
                cmb = (ComboBox)sender;
                if (_entityListD.Count > i && i != -1)
                {
                    // コンボボックスID連携
                    _entityListD[i]._tax_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.TAX_DIVISION_ID, ExCast.zCStr(cmb.SelectedValue));

                    // 課税区分が課税で内訳が消費税の場合
                    if (_entityListD[i]._tax_division_id == 1 && _entityListD[i]._breakdown_id == 5)
                    {
                        ExMessageBox.Show("内訳が消費税の場合、課税区分に課税を選択できません。");
                        _entityListD[i]._tax_division_nm = "非課税";
                        _entityListD[i]._tax_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.TAX_DIVISION_ID, ExCast.zCStr(_entityListD[i]._tax_division_nm));
                    }

                    // 明細計算
                    DataDetail.CalcDetail(i, _entityH, _entityListD);
                }
                break;

            case "txtGoodsNm":
            case "txtDetailMemo":
                break;
            }
        }
Exemple #30
0
        private void txt_GotFocus(object sender, RoutedEventArgs e)
        {
            GetUserControlFKey().SetFunctionKeyEnable("F5", false);
            activeControl = (Control)sender;
            beforeValue   = "";
            SetControl();

            if ((_entityListD.Count > DataForm.CurrentIndex && DataForm.CurrentIndex != -1) == false)
            {
                return;
            }

            switch (activeControl.Name)
            {
            case "txtGoodsId":
            case "txtUnitPrice":
                GetUserControlFKey().SetFunctionKeyEnable("F5", true);
                break;

            default:
                GetUserControlFKey().SetFunctionKeyEnable("F5", false);
                break;
            }

            beforeSelectedIndex = DataForm.CurrentIndex;

            switch (activeControl.Name)
            {
            case "txtNo":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._rec_no); break;

            case "cmbBreakdown":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._breakdown_nm); break;

            case "txtDeliverDivision":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._tax_division_nm); break;

            case "txtGoodsId":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._commodity_id); break;

            case "txtGoodsNm":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._commodity_name); break;

            case "cboUnit":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._unit_nm); break;

            case "txtCaseNum":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._case_number); break;

            case "txtEnterNum":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._enter_number); break;

            case "txtNumber":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._number); break;

            case "txtUnitPrice":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._unit_price); break;

            case "txtPrice":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._price); break;

            case "cboTaxDivision":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._breakdown_nm); break;

            case "txtDetailMemo":
                beforeValue = ExCast.zCStr(_entityListD[beforeSelectedIndex]._memo); break;
            }
        }