コード例 #1
0
ファイル: URight.cs プロジェクト: peter-ay/sl
        public static bool Check(string funCode, bool f_IsCheck = true)
        {
            if (!USysInfo.F_Manager && f_IsCheck)
            {
                var items = Rights.Where(it => it.FunCode == funCode).Count();
                if (items == 0)
                {
                    MessageErp.ErrorMessage(ErpUIText.Get("ERP_RightErr"));
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(funCode))
            {
                var _log = new MS_Log()
                {
                    DBCode   = USysInfo.DBCode,
                    UserCode = USysInfo.UserCode,
                    ClientID = USysInfo.ClientID,
                    FunCode  = funCode,
                    IP       = USysInfo.IP
                };

                DS_Bill.Add(USysInfo.DBERP, USysInfo.LgIndex, _log, geted =>
                {
                    if (geted.HasError)
                    {
                        geted.MarkErrorAsHandled();
                        return;
                    }
                }, null);
            }

            return(true);
        }
コード例 #2
0
 partial void OnCreated()
 {
     this.EditState = 1;
     ////////////////////////////////////////
     ID         = "";
     BCode      = "";
     FBCode     = "";
     BDate      = System.DateTime.Now;;
     BType      = "KFDBPD";
     StCode     = "DSH";
     StName     = ErpUIText.Get("ERP_New");
     WhCodeIn   = "";
     WhCodeOut  = "";
     Remark     = "";
     Maker      = USysInfo.UserCode;
     MName      = "";
     CheckerIn  = "";
     ChNameIn   = "";
     CheckerOut = "";
     ChNameOut  = "";
     LensCode   = "";
     FBCode     = "";
     F_LR       = "";
     WhNameIn   = "";
     WhNameOut  = "";
 }
コード例 #3
0
 partial void OnCreated()
 {
     this.EditState = 1;
     ////////////////////////////////////////
     ID           = "";
     BCode        = "";
     FBCode       = "";
     BDate        = System.DateTime.Now;;
     BType        = "KFSOPD";
     StCode       = "DSH";
     StName       = ErpUIText.Get("ERP_New");
     CusCode      = "";
     WhCode       = "";
     Remark       = "";
     Maker        = USysInfo.UserCode;
     MName        = "";
     Checker      = "";
     ChName       = "";
     Deler        = "";
     DelName      = "";
     LensCode     = "";
     F_LR         = "";
     LensCodeSale = "";
     BCodeSale    = "";
     OBCodeSale   = "";
     RemarkSale   = "";
     NotesSale    = "";
     CusName      = "";
     WhName       = "";
     LensName     = "";
     LensNameSale = "";
 }
コード例 #4
0
ファイル: MV_Sale_Order_SD.cs プロジェクト: peter-ay/sl
        private void dds_LoadedData(object s, System.Windows.Controls.LoadedDataEventArgs geted)
        {
            if (geted.HasError)
            {
                geted.MarkErrorAsHandled();
                return;
            }

            var item = geted.Entities.FirstOrDefault() as V_Sale_Order_SD;

            if (null == item)
            {
                return;
            }

            if (_NoticeCount != 0)
            {
                return;
            }

            _NoticeCount++;
            var _msg           = ErpUIText.Get("Sale_Bill_LensCode_SD_Err_OBillCodeSame") + item.OBCode;
            MessageWindowErp u = new MessageWindowErp(_msg, MessageWindowErp.MessageType.Info);

            u.Closed += (s1, e1) =>
            {
                Messenger.Default.Send <string>("", USysMessages.OBillCodeFocus);
                return;
            };
            u.Show();
        }
コード例 #5
0
        public static void Export(List<string> billcodes, bool is_cx)
        {
            if (billcodes.Count > 100)
            {
                MessageErp.ErrorMessage(ErpUIText.ErrMsg + ErpUIText.Get("MoreThan100"));
                return;
            }

            dialog = new SaveFileDialog();
            dialog.DefaultExt = ".xls";
            dialog.Filter = "Excel Files|*.xls|All Files|*.*";
            dialog.FilterIndex = 1;
            //dialog.DefaultFileName = "MDExcel_" + DateTime.Now.ToShortDateString();

            bool? dialogResult = dialog.ShowDialog();
            if (dialogResult != true) return;
            try
            {
                Messenger.Default.Send<string>("", USysMessages.FunLoadBegin);
                DSExportToFactory ds = new DSExportToFactory();
                ds.ExportExcelToFactory(billcodes, is_cx, USysInfo.UserCode, OnExportToFactoryCompleted, null);
            }
            catch
            {
                Messenger.Default.Send<string>("", USysMessages.FunLoadEnd);
                MessageErp.ErrorMessage(ErpUIText.ErrMsg);
            }
        }
コード例 #6
0
 partial void OnCreated()
 {
     this.EditState = 1;
     this.MyNotes   = "";
     ///////////////////////////////
     this.BillCode          = "";
     this.BillDate          = DateTime.Now;
     this.ConsignDate       = DateTime.Now.AddDays(2);
     this.OBillCode         = "";
     this.CusCode           = "";
     this.SupplierCode      = "";
     this.SerialNum         = "";
     this.Out_Good          = DateTime.Now.AddDays(2).Day.ToString();
     this.BillType          = "XSPD";
     this.BillState         = "DSH";
     this.Remark            = "";
     this.Notes             = "";
     this.Maker             = USysInfo.UserCode;
     this.Checker           = "";
     this.FromBillCode      = "";
     this.WhCode            = "";
     this.TempAddress       = "";
     this.TempDeptCode      = "";
     this.Flag_ReOrder      = false;
     this.Flag_UnLock       = false;
     this.Flag_Cancel       = false;
     this.Flag_Close        = false;
     this.Flag_Import       = false;
     this.Flag_WebOrder     = false;
     this.Mnumber           = "";
     this.CusName           = "";
     this.AreaName          = "";
     this.DeliveryAddress   = "";
     this.DeptCode          = "";
     this.DeptName          = "";
     this.PersonCode        = "";
     this.ForeignCurrName   = "";
     this.PayWayName        = "";
     this.TradeWayName      = "";
     this.TransferWayName   = "";
     this.StateName         = ErpUIText.Get("ERP_New");
     this.TypeName          = "";
     this.Mname             = "";
     this.WhName            = "";
     this.SupplierName      = "";
     this.DeliveryNum       = "";
     this.UpdateMoney       = 0;
     this.UpdateMoneyReason = "";
     this.MnumberReplace    = "";
     this.MnameReplace      = "";
     this.LR_Flag           = "";
 }
コード例 #7
0
ファイル: MV_Sale_ContractBill.cs プロジェクト: peter-ay/sl
 partial void OnCreated()
 {
     this.BeginDate     = DateTime.Now;
     this.Checker       = "";
     this.ContractCode  = "";
     this.ContractDate  = DateTime.Now;
     this.ContractState = "DSH";
     this.ContractType  = "";
     this.CusType       = "";
     this.EndDate       = DateTime.Now.AddYears(2);
     this.Maker         = USysInfo.UserCode;
     this.Remark        = "";
     this.StateName     = ErpUIText.Get("ERP_New");
     this.TypeName      = "";
 }
コード例 #8
0
 private static void OnFuntionCompleted(string fileName)
 {
     Messenger.Default.Send <string>("", USysMessages.FunLoadBegin);
     _DS.ImportCompleted(USysInfo.DBCode, USysInfo.LgIndex, fileName, _TableName, _BID, geted =>
     {
         Messenger.Default.Send <string>("", USysMessages.FunLoadEnd);
         if (geted.HasError)
         {
             MessageErp.ErrorMessage(geted.Error.Message.GetErrMsg());
             geted.MarkErrorAsHandled();
             return;
         }
         MessageErp.InfoMessage(ErpUIText.Get("ERP_ImportSucceed") + "[" + geted.Value.ToString() + "]");
         Messenger.Default.Send <string>("", USysMessages.OnImportCompleted);
     }, null);
 }
コード例 #9
0
 partial void OnCreated()
 {
     this.EditState = 1;
     this.BegDate   = DateTime.Now;
     this.Checker   = "";
     this.BCode     = "";
     this.OBCode    = "";
     this.BDate     = DateTime.Now;
     this.BType     = "CGPC";
     this.PriCode   = 1;
     this.StCode    = "DSH";
     this.SpGroup   = "";
     this.GpNameNew = "";
     this.EndDate   = DateTime.Now.AddYears(2);
     this.Maker     = USysInfo.UserCode;
     this.Remark    = "";
     this.StName    = ErpUIText.Get("ERP_New");
 }
コード例 #10
0
        private static void OnExportToFactoryCompleted(InvokeOperation geted)
        {
            Messenger.Default.Send<string>("", USysMessages.FunLoadEnd);
            if (geted.HasError)
            {

                MessageErp.ErrorMessage(geted.Error.Message.GetErrMsg());
                geted.MarkErrorAsHandled();
                return;
            }
            fileBytes = geted.Value as byte[];
            using (Stream fs = dialog.OpenFile())
            {
                fs.Write(fileBytes, 0, fileBytes.Length);
                fs.Close();
            }
            MessageErp.InfoMessage(ErpUIText.Get("ERP_ExportSuccecced"));
            Messenger.Default.Send<string>("", USysMessages.ExportToExcelSuccessed);
        }
コード例 #11
0
 partial void OnCreated()
 {
     this.EditState = 1;
     ////////////////////////////////////////
     ID          = "";
     BCode       = "";
     WhCode      = ComHelpWhCode.UHV_B_Warehouse_Browse.OrderBy(item => item.Priority).FirstOrDefault().WhCode;
     LensCode    = "";
     F_LR        = "";
     BDate       = DateTime.Now;
     Maker       = USysInfo.UserCode;
     Checker     = "";
     ChName      = "";
     this.BType  = "KFBSL";
     this.StCode = "DSH";
     this.StName = ErpUIText.Get("ERP_New");
     Remark      = "";
     SumQty      = 0;
     BrowseRight = "";
 }
コード例 #12
0
        public static void Open(string functionID, string FunCode, string funName = "", string extend = "", bool f_CheckRight = true)
        {
            if (string.IsNullOrEmpty(funName))
            {
                try
                {
                    funName = URight.Rights.Where(it => it.FunCode == FunCode).FirstOrDefault().FunName;
                }
                catch { }
            }

            if (string.IsNullOrEmpty(funName))
            {
                funName = ErpUIText.Get(FunCode);
            }

            ComWinsInfo.FunID        = functionID;
            ComWinsInfo.FunCode      = FunCode;
            ComWinsInfo.FunName      = funName.UIStr();
            ComWinsInfo.Extend       = extend;
            ComWinsInfo.F_CheckRight = f_CheckRight;
            Messenger.Default.Send <string>((""), USysMessages.AddTab);
        }
コード例 #13
0
        public static void Import(string tableName, string bID = "")
        {
            _TableName = tableName;
            _BID       = bID;
            try
            {
                OpenFileDialog dialog = new OpenFileDialog();
                dialog.Multiselect = false;
                dialog.Filter      = "Excel Files |*.xls";
                if ((bool)dialog.ShowDialog())
                {
                    _ID = DateTime.Now.Year.ToString() + (DateTime.Now.Month.ToString().Length == 2 ? DateTime.Now.Month.ToString() : "0" + DateTime.Now.Month.ToString()) + DateTime.Now.Day + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString();
                    InitUploadPara();
                    _OpenFileName      = dialog.File.Name;
                    _OpenFileExtension = dialog.File.Extension;
                    _FileStream        = dialog.File.OpenRead();
                    _FileLength        = dialog.File.Length;
                    _FileLengthVs      = _FileLength;

                    if (_FileLength > (100 * 1024 * 1024))
                    {
                        MessageErp.ErrorMessage(ErpUIText.Get("Err_LargeThan100M"));
                        try { _FileStream.Close(); }
                        catch { }
                        return;
                    }
                    SentFileStream(true);
                }
            }

            catch (IOException)
            {
                try { _FileStream.Close(); }
                catch { }
                MessageErp.ErrorMessage(ErpUIText.Get("ERP_FileInUse"));
            }
        }
コード例 #14
0
ファイル: MV_Sale_Order_PD.cs プロジェクト: peter-ay/sl
 partial void OnCreated()
 {
     //this._IsNoticeForRepeat = false;
     this._NoticeCount = 0;
     this.EditState    = 1;
     ////////////////////////////////////////
     this.MyNotes = "";
     /////////////////////////////////
     this.ID        = "";
     this.UD        = 1;
     this.BCode     = "";
     this.BDate     = DateTime.Now;
     this.CsDate    = DateTime.Now.AddDays(2);
     this.OBCode    = "";
     this.CusCode   = "";
     this.WhName    = "";
     this.SpName    = "";
     this.SpCode    = "";
     this.BType     = "XSPD";
     this.F_LR      = "";
     this.StCode    = "DSH";
     this.StName    = ErpUIText.Get("ERP_New");
     this.Remark    = "";
     this.Notes     = "";
     this.Maker     = USysInfo.UserCode;
     this.Checker   = "";
     this.FBCode    = "";
     this.WhCode    = ComHelpWhCode.UHV_B_Warehouse_Browse.Count == 0 ? "" : ComHelpWhCode.UHV_B_Warehouse_Browse.OrderBy(item => item.Priority).FirstOrDefault().WhCode;
     this.OGType    = 1;
     this.LensCode  = "";
     this.LensCodeR = "";
     this.LensName  = "";
     this.CusName   = "";
     this.TypeName  = "";
     this.LensNameR = "";
 }
コード例 #15
0
 public RadioButtonPrintBigFormatY()
     : base("IsEnablePPYN", "PBFYN", ErpUIText.Get("ERP_RadioButtonPrintBigFormatY"), "CmdRBCdiPPYN", "1")
 {
 }
コード例 #16
0
ファイル: XYInput.xaml.cs プロジェクト: peter-ay/sl
        private void InitDataGrid()
        {
            XY_DataGrid.Columns.Clear();
            DataGridTextColumn dg = null;

            for (int i = 1; i <= 100; i++)
            {
                dg = new DataGridTextColumn()
                {
                    Binding = new System.Windows.Data.Binding("C" + i.ToString())
                    {
                        UpdateSourceTrigger = System.Windows.Data.UpdateSourceTrigger.PropertyChanged,
                        FallbackValue       = 0,
                    },
                    Visibility = System.Windows.Visibility.Collapsed,
                    FontFamily = new FontFamily("Verdana"),
                    FontWeight = FontWeights.Normal,
                };
                XY_DataGrid.Columns.Add(dg);
            }

            XY_DataGrid.GotFocus += (s, e) =>
            {
                if (!XY_DataGrid.IsReadOnly)
                {
                    if (XY_DataGrid.Columns.Count > 0 && XY_DataGrid.SelectedIndex > -1)
                    {
                        XY_DataGrid.BeginEdit();
                        return;
                    }

                    if (XY_DataGrid.Columns.Count > 0 && XY_DataGrid.SelectedIndex == -1)
                    {
                        XY_DataGrid.SelectedIndex = 0;
                        XY_DataGrid.BeginEdit();
                        return;
                    }
                }
            };

            XY_DataGrid.CurrentCellChanged += (s1, e1) =>
            {
                XY_DataGrid.BeginEdit();
            };

            XY_DataGrid.CellEditEnded += new EventHandler <DataGridCellEditEndedEventArgs>(XY_DataGrid_CellEditEnded);

            XY_DataGrid.LoadingRow += (ss, ee) =>
            {
                var dc = ee.Row.DataContext as ComXYInputDataSource;
                ee.Row.Background = new SolidColorBrush(Color.FromArgb(255, 248, 248, 255));
                ee.Row.Header     = dc.C0.ToString();
                if (ee.Row.Header.ToString() == "-1")
                {
                    ee.Row.Header    = ErpUIText.Get("ERP_Sum");
                    ee.Row.IsEnabled = false;
                }
                else
                {
                    ee.Row.IsEnabled = true;
                }
            };

            XY_DataGrid.BindingValidationError += (e, s) =>
            {
                XY_DataGrid.CancelEdit();
                s.Handled = true;
            };
        }
コード例 #17
0
ファイル: RadioButtonYN.cs プロジェクト: peter-ay/sl
 public RadioButtonYNALL()
     : base("IsEnableYN", "YN", ErpUIText.Get("ERP_YNAll"), "CmdRBCdiYN", "0")
 {
 }
コード例 #18
0
ファイル: RadioButtonYN.cs プロジェクト: peter-ay/sl
 public RadioButtonUnYN()
     : base("IsEnableYN", "YN", ErpUIText.Get("ERP_UnYN"), "CmdRBCdiYN", "2")
 {
 }
コード例 #19
0
 public RadioButtonRTypeN()
     : base("IsEnableRType", "RT", ErpUIText.Get("ERP_RadioButtonRTypeN"), "CmdRBCdiRType", "N")
 {
     base.SetIsCheck("IsCheckRTypeN");
 }
コード例 #20
0
 public RadioButtonOG1()
     : base("IsEnableOG", "Og", ErpUIText.Get("ERP_RadioButtonOG1"), "CmdRBCdiOG", "1")
 {
     this.SetIsCheck("IsCheckOG1");
 }
コード例 #21
0
 public RadioButtonUnBarCodeScan()
     : base("", "De", ErpUIText.Get("ERP_WS"), "CmdRBCdiBarCodeScan", "0")
 {
 }
コード例 #22
0
ファイル: RadioButtonCheck.cs プロジェクト: peter-ay/sl
 public RadioButtonUnCheckOut()
     : base("", "ChOut", ErpUIText.Get("ERP_RadioButtonUnCheck"), "CmdRBCdiCheckOut", "0")
 {
 }
コード例 #23
0
ファイル: RadioButtonCheck.cs プロジェクト: peter-ay/sl
 public RadioButtonCheckALLOut()
     : base("", "ChOut", ErpUIText.Get("ERP_RadioButtonCheckALL"), "CmdRBCdiCheckOut", "-1")
 {
 }
コード例 #24
0
 public RadioButtonUnclude()
     : base("", "Ic", ErpUIText.Get("ERP_RadioButtonIncludeWF"), "CmdRBCdiInclude", "0")
 {
 }
コード例 #25
0
ファイル: XYInput.xaml.cs プロジェクト: peter-ay/sl
        private void RefreshColumns(ComXYInputMainDataSource msg)
        {
            //每次都刷新
            _CCYL1 = -1; _CCYL2 = -1;
            //////////////////////////////
            if (_CCYL1 != msg.CYL1 || _CCYL2 != msg.CYL2)
            {
                _CCYL1 = msg.CYL1;
                _CCYL2 = msg.CYL2;
                foreach (var c in this.XY_DataGrid.Columns)
                {
                    c.Visibility = Visibility.Collapsed;
                    c.IsReadOnly = false;
                }

                #region CYL排序

                cylArray.Clear();
                var cyl1    = msg.CYL1;
                var cyl2    = msg.CYL2;
                int c_index = 0;
                if (cyl2 <= 0)
                {
                    for (int j = cyl2; j >= cyl1; j -= 25)
                    {
                        XY_DataGrid.Columns[c_index].Visibility = Visibility.Visible;
                        XY_DataGrid.Columns[c_index].Header     = j.ToString();
                        cylArray.Add(j);
                        c_index++;
                    }
                }
                else if (cyl1 >= 0)
                {
                    for (int j = cyl1; j <= cyl2; j += 25)
                    {
                        XY_DataGrid.Columns[c_index].Visibility = Visibility.Visible;
                        XY_DataGrid.Columns[c_index].Header     = j.ToString();
                        cylArray.Add(j);
                        c_index++;
                    }
                }
                else
                {
                    for (int j = 0; j >= cyl1; j -= 25)
                    {
                        XY_DataGrid.Columns[c_index].Visibility = Visibility.Visible;
                        XY_DataGrid.Columns[c_index].Header     = j.ToString();
                        cylArray.Add(j);
                        c_index++;
                    }
                    for (int j = 25; j <= cyl2; j += 25)
                    {
                        XY_DataGrid.Columns[c_index].Visibility = Visibility.Visible;
                        XY_DataGrid.Columns[c_index].Header     = j.ToString();
                        cylArray.Add(j);
                        c_index++;
                    }
                }
                XY_DataGrid.Columns[c_index].Visibility = Visibility.Visible;
                XY_DataGrid.Columns[c_index].Header     = ErpUIText.Get("ERP_Sum");
                XY_DataGrid.Columns[c_index].IsReadOnly = true;
                #endregion
            }
            this.FillResult();
        }
コード例 #26
0
 public RadioButtonBarCodeScanALL()
     : base("", "De", ErpUIText.Get("ERP_All"), "CmdRBCdiBarCodeScan", "-1")
 {
 }
コード例 #27
0
ファイル: MV_Sale_Order_SD.cs プロジェクト: peter-ay/sl
 partial void OnCreated()
 {
     this._IsNoticeForRepeat = false;
     this._NoticeCount       = 0;
     this.EditState          = 1;
     this.MyNotes            = "";
     /////////////////////////////////
     this.ID      = "";
     this.UD      = 1;
     this.BCode   = "";
     this.OdDate  = DateTime.Now;
     this.CsDate  = DateTime.Now.AddDays(2);
     this.OBCode  = "";
     this.CusCode = "";
     this.SpCode  = "";
     this.BType   = 31;
     this.BState  = 1;
     this.Remark  = "";
     this.Notes   = "";
     this.Maker   = USysInfo.UserCode;
     this.Checker = "";
     this.FBCode  = "";
     this.WhCode  = "";
     //this.TempAddress = "";
     this.DpCodeWG = "";
     this.DpCodeJG = "";
     //this.Flag_ReOrder = false;
     //this.Flag_UnLock = false;
     //this.Flag_CX = false;
     //this.Flag_Cancel = false;
     //this.Flag_Close = false;
     //this.Flag_Import = false;
     //this.Flag_WebOrder = false;
     this.LensCodeR  = "";
     this.LensCodeRR = "";
     this.SPHR       = 0;
     this.CYLR       = 0;
     this.X_ADDR     = 0;
     this.QtyR       = 1;
     this.DiaR       = 0;
     this.AxisR      = 180;
     this.CTR        = "";
     this.D1R        = "";
     this.D2R        = "";
     this.D3R        = "";
     this.D4R        = "";
     this.P1R        = "";
     this.P2R        = "";
     this.P3R        = "";
     this.P4R        = "";
     this.DBR        = false;
     this.BASER      = "";
     this.LensCodeL  = "";
     this.LensCodeRL = "";
     this.SPHL       = 0;
     this.CYLL       = 0;
     this.X_ADDL     = 0;
     this.QtyL       = 1;
     this.DiaL       = 0;
     this.AxisL      = 180;
     this.CTL        = "";
     this.D1L        = "";
     this.D2L        = "";
     this.D3L        = "";
     this.D4L        = "";
     this.P1L        = "";
     this.P2L        = "";
     this.P3L        = "";
     this.P4L        = "";
     this.DBL        = false;
     this.BASEL      = "";
     this.CXType     = 1;
     this.UV         = false;
     this.JY         = false;
     this.JJ         = "";
     this.CS         = "";
     this.RS         = "";
     this.RSName     = "";
     this.JS         = "";
     this.SY         = "";
     this.ZK         = "";
     this.OP         = "";
     this.ChB        = "";
     this.PG         = "";
     this.KK         = "";
     this.CB         = "";
     this.PH         = "";
     this.CusName    = "";
     this.DpNameWG   = "";
     this.DpNameJG   = "";
     this.StateName  = ErpUIText.Get("ERP_New");
     this.TypeName   = "";
     this.LensNameR  = "";
     this.LensNameL  = "";
     this.LensNameRR = "";
     this.LensNameRL = "";
     this.WhName     = "";
     this.SpName     = "";
 }
コード例 #28
0
 public RadioButtonOGALL()
     : base("", "Og", ErpUIText.Get("ERP_RadioButtonOGALL"), "CmdRBCdiOG", "-1")
 {
     this.SetIsCheck("IsCheckOGALL");
 }
コード例 #29
0
 public RadioButtonIncludeALL()
     : base("", "Ic", ErpUIText.Get("ERP_RadioButtonIncludeAll"), "CmdRBCdiInclude", "-1")
 {
 }
コード例 #30
0
ファイル: RadioButtonCheck.cs プロジェクト: peter-ay/sl
 public RadioButtonCheckIn()
     : base("", "ChIn", ErpUIText.Get("ERP_RadioButtonCheck"), "CmdRBCdiCheckIn", "1")
 {
 }