예제 #1
0
        /// <summary>
        /// 文件批量删除
        /// </summary>
        private void DeleteAll(HttpContext Context)
        {
            Hashtable FileTable  = new Hashtable();
            int       Id         = 0;
            string    FolderPath = "";
            string    CodeId     = "";
            string    Extension  = "";
            string    FilePath   = "";
            int       Index      = 0;

            if (Context.Request.Form.GetValues("Id").Length == 0)
            {
                return;
            }

            for (Index = 0; Index < Context.Request.Form.GetValues("Id").Length; Index++)
            {
                if (Base.Common.IsNumeric(Context.Request.Form.GetValues("Id")[Index]) == true)
                {
                    Id = Context.Request.Form.GetValues("Id")[Index].TypeInt();
                }
                else
                {
                    continue;
                }

                if (AppCommon.PurviewCheck(Id, false, "creator", ref Conn) == false)
                {
                    continue;
                }

                Base.Data.SqlDataToTable("Select DBS_Id, DBS_Folder, DBS_FolderPath, DBS_CodeId, DBS_Extension, DBS_Lock From DBS_File Where DBS_Folder = 0 And DBS_Lock = 0 And DBS_Id = " + Id, ref Conn, ref FileTable);

                if (FileTable["Exist"].TypeBool() == false)
                {
                    continue;
                }
                else
                {
                    FolderPath = FileTable["DBS_FolderPath"].TypeString();
                    CodeId     = FileTable["DBS_CodeId"].TypeString();
                    Extension  = FileTable["DBS_Extension"].TypeString();
                }

                FileTable.Clear();

                FilePath = Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), FolderPath.Substring(1), CodeId + Extension);

                if (File.Exists(FilePath) == true)
                {
                    File.Delete(FilePath);
                    File.Delete("" + FilePath + ".pdf");
                    File.Delete("" + FilePath + ".flv");
                }

                Base.Data.SqlQuery("Delete From DBS_File Where DBS_Id = " + Id, ref Conn);
                Base.Data.SqlQuery("Delete From DBS_File_Purview Where DBS_FileId = " + Id, ref Conn);
                Base.Data.SqlQuery("Delete From DBS_File_Process Where DBS_FileId = " + Id, ref Conn);

                Delete_Version(Id, FolderPath, Context);

                AppCommon.Log(Id, "file-delete", ref Conn);
            }

            Context.Response.Write("complete");
        }
예제 #2
0
        /// <summary>
        /// 画面表示後のイベント処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            this.OkButton.FontSize     = 9;
            this.OkButton.Content      = "\n\n\n選択(F11)";
            this.CancelButton.FontSize = 9;
            this.CancelButton.Content  = "\n\n\n終了(F1)";

            AppCommon.SetutpComboboxList(this.OrderColumn, false);

            GridOutPut();
            this.OrderColumn.SelectionChanged += this.OrderColumn_SelectionChanged;

            if (TwinTextBox.LinkItem != null)
            {
                // 取引区分として値を設定
                int val = -1;
                if (int.TryParse(TwinTextBox.LinkItem.ToString(), out val))
                {
                    取引区分 = val;
                }
            }

            this.chkItemClass_1.IsChecked = IsSetItemEnabled;
            this.chkItemClass_1.IsEnabled = IsSetItemEnabled;

            // 画面サイズをタスクバーをのぞいた状態で表示させる
            this.Height = WinFormsScreen.PrimaryScreen.WorkingArea.Size.Height;

            // メイン画面と子画面が被ることなく表示できるかチェック
            if (WinFormsScreen.PrimaryScreen.WorkingArea.Size.Width < 1024 + 342)
            {
                // 画面の左端に表示させる
                this.Left = WinFormsScreen.PrimaryScreen.WorkingArea.Size.Width - this.Width;
            }

            #region 設定項目取得
            ucfg   = AppCommon.GetConfig(this);
            frmcfg = (ConfigSCHM09_HIN)ucfg.GetConfigValue(typeof(ConfigSCHM09_HIN));
            if (frmcfg == null)
            {
                frmcfg = new ConfigSCHM09_HIN();
                ucfg.SetConfigValue(frmcfg);
            }
            else
            {
                // 表示できるかチェック
                var WidthCHK = WinFormsScreen.PrimaryScreen.Bounds.Width - frmcfg.Left;
                if (WidthCHK > 10)
                {
                    this.Left = frmcfg.Left;
                }
                // 表示できるかチェック
                var HeightCHK = WinFormsScreen.PrimaryScreen.Bounds.Height - frmcfg.Top;
                if (HeightCHK > 10)
                {
                    this.Top = frmcfg.Top;
                }
                this.Height = frmcfg.Height;
                this.Width  = frmcfg.Width;

                this.OrderColumn.SelectedIndex = frmcfg.Combo_Copy;
            }
            #endregion
        }
예제 #3
0
        /// <summary>
        /// Extracts files from a merge module and creates corresponding ComponentGroup WiX authoring.
        /// </summary>
        private void MeltModule()
        {
            Decompiler decompiler = null;
            Unbinder   unbinder   = null;
            Melter     melter     = null;

            try
            {
                // create the decompiler, unbinder, and melter
                decompiler = new Decompiler();
                unbinder   = new Unbinder();
                melter     = new Melter(decompiler, id);

                // read the configuration file (melt.exe.config)
                AppCommon.ReadConfiguration(this.extensionList);

                // load any extensions
                foreach (string extension in this.extensionList)
                {
                    WixExtension wixExtension = WixExtension.Load(extension);

                    decompiler.AddExtension(wixExtension);
                    unbinder.AddExtension(wixExtension);
                }

                // set options
                decompiler.TempFilesLocation = Environment.GetEnvironmentVariable("WIX_TEMP");

                unbinder.TempFilesLocation        = Environment.GetEnvironmentVariable("WIX_TEMP");
                unbinder.SuppressDemodularization = true;

                decompiler.Message += new MessageEventHandler(this.messageHandler.Display);
                unbinder.Message   += new MessageEventHandler(this.messageHandler.Display);
                melter.Message     += new MessageEventHandler(this.messageHandler.Display);

                // print friendly message saying what file is being decompiled
                Console.WriteLine(Path.GetFileName(this.inputFile));

                // unbind
                Output output = unbinder.Unbind(this.inputFile, this.outputType, this.exportBasePath);

                if (null != output)
                {
                    Wix.Wix wix = melter.Melt(output);
                    if (null != wix)
                    {
                        XmlTextWriter writer = null;

                        try
                        {
                            writer = new XmlTextWriter(this.outputFile, System.Text.Encoding.UTF8);

                            writer.Indentation = 4;
                            writer.IndentChar  = ' ';
                            writer.QuoteChar   = '"';
                            writer.Formatting  = Formatting.Indented;

                            writer.WriteStartDocument();
                            wix.OutputXml(writer);
                            writer.WriteEndDocument();
                        }
                        finally
                        {
                            if (null != writer)
                            {
                                writer.Close();
                            }
                        }
                    }
                }
            }
            finally
            {
                if (null != decompiler)
                {
                    if (this.tidy)
                    {
                        if (!decompiler.DeleteTempFiles())
                        {
                            Console.WriteLine(MeltStrings.WAR_FailedToDeleteTempDir, decompiler.TempFilesLocation);
                        }
                    }
                    else
                    {
                        Console.WriteLine(MeltStrings.INF_TempDirLocatedAt, decompiler.TempFilesLocation);
                    }
                }

                if (null != unbinder)
                {
                    if (this.tidy)
                    {
                        if (!unbinder.DeleteTempFiles())
                        {
                            Console.WriteLine(MeltStrings.WAR_FailedToDeleteTempDir, unbinder.TempFilesLocation);
                        }
                    }
                    else
                    {
                        Console.WriteLine(MeltStrings.INF_TempDirLocatedAt, unbinder.TempFilesLocation);
                    }
                }
            }
        }
예제 #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            TBL_MP_CRM_SalesOrder model   = null;
            ServiceSalesOrder     service = new ServiceSalesOrder();

            try
            {
                errorProvider1.Clear();
                if (!this.ValidateChildren())
                {
                    return;
                }

                if (this.SalesOrderID == 0)
                {
                    model = new TBL_MP_CRM_SalesOrder();
                }
                else
                {
                    model = service.GetSalesOrderDBInfoByID(this.SalesOrderID);
                }

                model.FK_SalesOrderType   = service.SO_TYPE_PRIMARY_ID;
                model.SalesOrderNo        = txtSalesOrderNo.Text;
                model.SalesOrderDate      = dtSalesOrderDate.Value;
                model.FK_POSource         = ((SelectListItem)cboPOSources.SelectedItem).ID;
                model.FK_SalesOrderStatus = ((SelectListItem)cboSalesOrderStatus.SelectedItem).ID;
                model.FK_ClientID         = ((SelectListItem)cboClient.SelectedItem).ID;
                model.FK_QuotationID      = this.SelectedQuotationID;
                model.FK_ProjectID        = ((SelectListItem)cboProjects.SelectedItem).ID;
                model.IsActive            = true;

                if (txtMaterialSupplyPoNo.Text.Trim() != string.Empty)
                {
                    model.MaterialSupplyPONo         = txtMaterialSupplyPoNo.Text.Trim();
                    model.MaterialSupplyPODate       = dtMaterialSupplyPoDate.Value;
                    model.MaterialSupplyPOValidDays  = int.Parse(txtMaterialSupplyPoValidDays.Text.Trim());
                    model.MaterialSupplyPOExpiryDate = dtMaterialSupplyPoExpiryDate.Value;
                }
                else
                {
                    model.MaterialSupplyPONo         = null;
                    model.MaterialSupplyPODate       = null;
                    model.MaterialSupplyPOValidDays  = null;
                    model.MaterialSupplyPOExpiryDate = null;
                }

                if (txtInstallationServicePoNo.Text.Trim() != string.Empty)
                {
                    model.InstallationServicePONo         = txtInstallationServicePoNo.Text.Trim();
                    model.InstallationServicePODate       = dtInstallationServicePoDate.Value;
                    model.InstallationServicePOValidDays  = int.Parse(txtInstallationServicePoValidDays.Text.Trim());
                    model.InstallationServicePOExpiryDate = dtInstallationServicePoExpiryDate.Value;
                }
                else
                {
                    model.InstallationServicePONo         = null;
                    model.InstallationServicePODate       = null;
                    model.InstallationServicePOValidDays  = null;
                    model.InstallationServicePOExpiryDate = null;
                }

                if (this.SalesOrderID == 0)
                {
                    model.CreatedBy    = Program.CURR_USER.EmployeeID;
                    model.CreatedDate  = AppCommon.GetServerDateTime();
                    model.FK_CompanyID = Program.CURR_USER.CompanyID;
                    model.FK_BranchID  = Program.CURR_USER.BranchID;
                    model.FK_YearID    = Program.CURR_USER.FinYearID;
                    this.SalesOrderID  = service.AddNewSalesOrder(model);
                }
                else
                {
                    model.ModifiedBy   = Program.CURR_USER.EmployeeID;
                    model.ModifiedDate = AppCommon.GetServerDateTime();
                    service.UpdateSalesOrder(model);
                }

                this.DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "frmSO_Primary::btnSave_Click", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #5
0
        /// <summary>
        /// 文件夹移动
        /// </summary>
        private void Move(HttpContext Context)
        {
            Hashtable FileTable           = new Hashtable();
            int       Id                  = 0;
            string    FolderPath          = "";
            string    Name                = "";
            int       FolderId            = 0;
            string    FolderIdPath        = "";
            string    FolderNewName       = "";
            int       FolderUserId        = 0;
            string    FolderUsername      = "";
            int       FolderShare         = 0;
            int       FolderSync          = 0;
            string    SourceDirectoryPath = "";
            string    TargetDirectoryPath = "";

            if (Base.Common.IsNumeric(Context.Request.Form["Id"]) == true)
            {
                Id = Context.Request.Form["Id"].TypeInt();
            }
            else
            {
                return;
            }

            if (Base.Common.IsNumeric(Context.Request.Form["FolderId"]) == true)
            {
                FolderId = Context.Request.Form["FolderId"].TypeInt();
            }
            else
            {
                return;
            }

            if (AppCommon.PurviewCheck(Id, true, "creator", ref Conn) == false)
            {
                Context.Response.Write("no-permission");
                return;
            }

            FolderPath = AppCommon.FolderIdPath(Id, ref Conn);

            Base.Data.SqlDataToTable("Select DBS_Id, DBS_Folder, DBS_Name, DBS_Lock From DBS_File Where DBS_Folder = 1 And DBS_Lock = 0 And DBS_Id = " + Id, ref Conn, ref FileTable);

            if (FileTable["Exist"].TypeBool() == false)
            {
                return;
            }
            else
            {
                Name = FileTable["DBS_Name"].TypeString();
            }

            FileTable.Clear();

            if (FolderId == 0)
            {
                FolderIdPath   = "/0/";
                FolderUserId   = Context.Session["UserId"].TypeInt();
                FolderUsername = Context.Session["Username"].TypeString();
            }
            else
            {
                FolderIdPath = AppCommon.FolderIdPath(FolderId, ref Conn);

                // 判断是否移动到子文件夹
                if (FolderIdPath.IndexOf("/" + Id + "/") > -1)
                {
                    if (FolderIdPath.Substring(FolderIdPath.IndexOf("/" + Id + "/")).IndexOf("/" + FolderId + "/") > -1)
                    {
                        return;
                    }
                }

                if (AppCommon.PurviewCheck(FolderId, true, "manager", ref Conn) == false)
                {
                    Context.Response.Write("no-permission");
                    return;
                }

                Base.Data.SqlDataToTable("Select DBS_Id, DBS_UserId, DBS_Username, DBS_Folder, DBS_Share, DBS_Lock, DBS_Sync From DBS_File Where DBS_Folder = 1 And DBS_Lock = 0 And DBS_Id = " + FolderId, ref Conn, ref FileTable);

                if (FileTable["Exist"].TypeBool() == false)
                {
                    return;
                }
                else
                {
                    FolderUserId   = FileTable["DBS_UserId"].TypeInt();
                    FolderUsername = FileTable["DBS_Username"].TypeString();
                    FolderShare    = FileTable["DBS_Share"].TypeInt();
                    FolderSync     = FileTable["DBS_Sync"].TypeInt();
                }

                FileTable.Clear();
            }

            SourceDirectoryPath = Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), FolderPath.Substring(1));

            if (FolderId == 0)
            {
                TargetDirectoryPath = Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), Id.ToString());
            }
            else
            {
                TargetDirectoryPath = Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), FolderIdPath.Substring(1), Id.ToString());
            }

            if (SourceDirectoryPath == TargetDirectoryPath)
            {
                return;
            }

            if (Directory.Exists(SourceDirectoryPath) == true)
            {
                Directory.Move(SourceDirectoryPath, TargetDirectoryPath);
            }

            FolderNewName = AppCommon.FolderName(FolderId, Name, ref Conn);

            Base.Data.SqlQuery("Update DBS_File Set DBS_UserId = " + FolderUserId + ", DBS_Username = '******', DBS_FolderId = " + FolderId + ", DBS_FolderPath = '" + FolderIdPath + "', DBS_Name = '" + FolderNewName + "', DBS_Share = " + FolderShare + ", DBS_Sync = " + FolderSync + " Where DBS_Id = " + Id, ref Conn);

            Move_Subfolder(Id, FolderUserId, FolderUsername, FolderShare, FolderSync);

            PurviewSync(Id, FolderId);

            AppCommon.Log(Id, "folder-move", ref Conn);

            Context.Response.Write("complete");
        }
예제 #6
0
        /// <summary>
        /// ロードイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void Window_Loaded(object sender, RoutedEventArgs e)
        {
            #region 設定項目取得
            ucfg = AppCommon.GetConfig(this);
            ccfg = (CommonConfig)ucfg.GetConfigValue(typeof(CommonConfig));

            #region "権限関係"

            // 登録ボタン設定
            if (!権限Get.Authority_Update_Button(ccfg, this.GetType().Name))
            {
                // RibbonWindowViewBaseのプロパティに設定
                DataUpdateVisible = System.Windows.Visibility.Hidden;
            }

            frmcfg = (ConfigDLY03020)ucfg.GetConfigValue(typeof(ConfigDLY03020));

            #endregion

            if (frmcfg == null)
            {
                frmcfg = new ConfigDLY03020();
                ucfg.SetConfigValue(frmcfg);
                //画面サイズをタスクバーをのぞいた状態で表示させる
                //this.Height = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height;
            }
            else
            {
                //表示できるかチェック
                var WidthCHK = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - frmcfg.Left;
                if (WidthCHK > 10)
                {
                    this.Left = frmcfg.Left;
                }
                //表示できるかチェック
                var HeightCHK = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height - frmcfg.Top;
                if (HeightCHK > 10)
                {
                    this.Top = frmcfg.Top;
                }
                this.Width  = frmcfg.Width;
                this.Height = frmcfg.Height;
            }

            #endregion

            // 検索画面情報を設定
            base.MasterMaintenanceWindowList.Add("M01_TOK", new List <Type> {
                typeof(MST01010), typeof(SCHM01_TOK)
            });
            base.MasterMaintenanceWindowList.Add("M09_HIN", new List <Type> {
                typeof(MST02010), typeof(SCHM09_HIN)
            });
            base.MasterMaintenanceWindowList.Add("M11_TEK", new List <Type> {
                typeof(MST08010), typeof(SCHM11_TEK)
            });
            base.MasterMaintenanceWindowList.Add("M70_JIS", new List <Type> {
                typeof(MST16010), typeof(SCHM70_JIS)
            });
            base.MasterMaintenanceWindowList.Add("M21_SYUK", new List <Type> {
                typeof(MST01020), typeof(SCHM21_SYUK)
            });
            base.MasterMaintenanceWindowList.Add("M22_SOUK", new List <Type> {
                typeof(MST12020), typeof(SCHM22_SOUK)
            });

            // コンボデータ取得
            AppCommon.SetutpComboboxList(this.cmb伝票要否, false);
            AppCommon.SetutpComboboxList(this.cmb売上区分, false);
            gridCtl = new GcSpreadGridController(gcSpreadGrid);

            ScreenClear();
            ChangeKeyItemChangeable(true);

            // ログインユーザの自社区分によりコントロール状態切換え
            this.txt自社名.Text1     = ccfg.自社コード.ToString();
            this.txt自社名.IsEnabled = ccfg.自社販社区分.Equals((int)自社販社区分.自社);

            this.txt伝票番号.Focus();
        }
예제 #7
0
        /// <summary>
        /// F8 リボン 印刷
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF8Key(object sender, KeyEventArgs e)
        {
            PrinterDriver ret = AppCommon.GetPrinter(frmcfg.PrinterName);

            if (ret.Result == false)
            {
                this.ErrorMessage = "プリンタドライバーがインストールされていません!";
                return;
            }
            frmcfg.PrinterName = ret.PrinterName;


            if (!base.CheckAllValidation())
            {
                MessageBox.Show("入力内容に誤りがあります。");
                SetFocusToTopControl();
                return;
            }

            if (string.IsNullOrEmpty(作成締日))
            {
                this.ErrorMessage = "締日を入力してください。";
                MessageBox.Show("締日を入力してください。");
                SetFocusToTopControl();
                return;
            }

            if (string.IsNullOrEmpty(作成年))
            {
                this.ErrorMessage = "作成年を入力してください。";
                MessageBox.Show("作成年を入力してください。");
                SetFocusToTopControl();
                return;
            }
            if (string.IsNullOrEmpty(作成月))
            {
                this.ErrorMessage = "作成月を入力してください。";
                MessageBox.Show("作成月を入力してください。");
                SetFocusToTopControl();
                return;
            }


            int?[] i部門List = new int?[0];
            if (!string.IsNullOrEmpty(部門ピックアップ))
            {
                string[] 部門List = 部門ピックアップ.Split(',');
                i部門List = new int?[部門List.Length];

                for (int i = 0; i < 部門List.Length; i++)
                {
                    string str = 部門List[i];
                    int    code;
                    if (!int.TryParse(str, out code))
                    {
                        this.ErrorMessage = "部門指定の形式が不正です。";
                        return;
                    }
                    i部門List[i] = code;
                }
            }
            DateTime d集計期間From = DateTime.Parse(集計期間From.ToString()), d集計期間To = DateTime.Parse(集計期間To.ToString());

            base.SendRequest(new CommunicationObject(MessageType.RequestDataWithBusy, SEARCH_TKS18010, new object[] { 部門From, 部門To, i部門List, 部門ピックアップ, 作成締日, 作成年, 作成月, d集計期間From, d集計期間To }));
        }
        private void PopulateEmployeeGeneralInfo()
        {
            this.Cursor = Cursors.WaitCursor;
            Application.UseWaitCursor = true;
            try
            {
                MODEL_GeneralInfo = (new ServiceEmployee()).GetEmployeeGeneralInfo(this.SelectedEmployeeID);
                if (MODEL_GeneralInfo != null)
                {
                    pictureBoxItemImage.Image = null;
                    txtEmployeeCode.Text      = MODEL_GeneralInfo.EmployeeCode;
                    txtEmployeeID.Text        = MODEL_GeneralInfo.EmployeeID.ToString();
                    txtEmployeeName.Text      = MODEL_GeneralInfo.EmployeeFullName;
                    txtEmail.Text             = MODEL_GeneralInfo.EmployeeEmailAddress;
                    txtOfficeEmailAddr.Text   = MODEL_GeneralInfo.OfficialEmailAddress; //office email addr
                    txtOfficePhoneNo.Text     = MODEL_GeneralInfo.OfficialPhoneNo;      //office phone no
                    txtPhoneNo.Text           = MODEL_GeneralInfo.PhoneNo1;
                    txtAlternatePhoneNo.Text  = MODEL_GeneralInfo.AltPhoneNo;

                    if (MODEL_GeneralInfo.ImageFileName != null)
                    {
                        string filePath = string.Format("{0}{1}", AppCommon.GetEmployeeImagePath(), MODEL_GeneralInfo.ImageFileName);
                        if (File.Exists(filePath))
                        {
                            byte[] array = File.ReadAllBytes(filePath);
                            Bitmap image;
                            using (MemoryStream stream = new MemoryStream(array))
                            {
                                image = new Bitmap(stream);
                            }
                            pictureBoxItemImage.Image = image;
                        }
                    }

                    cboCategory.SelectedItem    = ((List <SelectListItem>)cboCategory.DataSource).Where(x => x.ID == MODEL_GeneralInfo.CategoryInfo.ID).FirstOrDefault();
                    cboDepartment.SelectedItem  = ((List <SelectListItem>)cboDepartment.DataSource).Where(x => x.ID == MODEL_GeneralInfo.DepartmentInfo.ID).FirstOrDefault();
                    cboDesignation.SelectedItem = ((List <SelectListItem>)cboDesignation.DataSource).Where(x => x.ID == MODEL_GeneralInfo.DesignationInfo.ID).FirstOrDefault();
                    cboBranch.SelectedItem      = ((List <SelectListItem>)cboBranch.DataSource).Where(x => x.ID == MODEL_GeneralInfo.EmployeeBranchInfo.ID).FirstOrDefault();
                    cboBoss.SelectedItem        = ((List <SelectListItem>)cboBoss.DataSource).Where(x => x.ID == MODEL_GeneralInfo.EmployeeBossInfo.ID).FirstOrDefault();
                    if (MODEL_GeneralInfo.DateOfJoining != null)
                    {
                        dtJoiningDate.Value   = MODEL_GeneralInfo.DateOfJoining.Value;
                        dtJoiningDate.Checked = true;
                    }
                    else
                    {
                        dtJoiningDate.Checked = false;
                    }

                    if (MODEL_GeneralInfo.ConfirmationDate != null)
                    {
                        dtConfirmationDate.Value   = MODEL_GeneralInfo.ConfirmationDate.Value;
                        dtConfirmationDate.Checked = true;
                    }
                    else
                    {
                        dtConfirmationDate.Checked = false;
                    }
                    if (MODEL_GeneralInfo.DateOfAppointment != null)
                    {
                        dtAppointmentDate.Value   = MODEL_GeneralInfo.DateOfAppointment.Value;
                        dtAppointmentDate.Checked = true;
                    }
                    else
                    {
                        dtAppointmentDate.Checked = false;
                    }


                    txtNoticePeriods.Text      = MODEL_GeneralInfo.NoticePeriod.ToString();
                    txtProbationPeriods.Text   = MODEL_GeneralInfo.ProbationPeriod.ToString();
                    txtResidentialAddress.Text = MODEL_GeneralInfo.ResidentialAddress;
                    txtPermanentAddress.Text   = MODEL_GeneralInfo.PermanentAddress;

                    for (int x = 0; x < checkListWeekOffs.Items.Count; x++)
                    {
                        checkListWeekOffs.SetItemChecked(x, false);
                    }
                    string[] arrWeekOffs = MODEL_GeneralInfo.WeekOffDays.Split(',');
                    for (int i = 0; i <= arrWeekOffs.GetUpperBound(0); i++)
                    {
                        for (int x = 0; x < checkListWeekOffs.Items.Count; x++)
                        {
                            if (checkListWeekOffs.Items[x].ToString() == arrWeekOffs[i])
                            {
                                checkListWeekOffs.SetItemChecked(x, true);
                            }
                        }
                    }
                    cboJoiningLocation.SelectedItem = ((List <SelectListItem>)cboJoiningLocation.DataSource).Where(x => x.ID == MODEL_GeneralInfo.JoiningLocationCityID).FirstOrDefault();
                }
                else
                {
                    txtEmployeeCode.Text            = txtEmployeeID.Text = txtEmployeeName.Text = txtEmail.Text =
                        txtPhoneNo.Text             = txtAlternatePhoneNo.Text = string.Empty;
                    txtOfficePhoneNo.Text           = txtOfficePhoneNo.Text = string.Empty;
                    txtOfficeEmailAddr.Text         = txtOfficeEmailAddr.Text = string.Empty;
                    cboCategory.SelectedItem        = ((List <SelectListItem>)cboCategory.DataSource).Where(x => x.ID == 0).FirstOrDefault();
                    cboDepartment.SelectedItem      = ((List <SelectListItem>)cboDepartment.DataSource).Where(x => x.ID == 0).FirstOrDefault();
                    cboDesignation.SelectedItem     = ((List <SelectListItem>)cboDesignation.DataSource).Where(x => x.ID == 0).FirstOrDefault();
                    cboBranch.SelectedItem          = ((List <SelectListItem>)cboBranch.DataSource).Where(x => x.ID == 0).FirstOrDefault();
                    cboBoss.SelectedItem            = ((List <SelectListItem>)cboBoss.DataSource).Where(x => x.ID == 0).FirstOrDefault();
                    cboJoiningLocation.SelectedItem = ((List <SelectListItem>)cboJoiningLocation.DataSource).Where(x => x.ID == 0).FirstOrDefault();
                    dtJoiningDate.Value             = dtConfirmationDate.Value = dtAppointmentDate.Value = new DateTime(1900, 1, 1);
                    txtNoticePeriods.Text           = txtProbationPeriods.Text = txtResidentialAddress.Text = txtPermanentAddress.Text = string.Empty;
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "ControlEmployeeGeneralInfo::PopulateEmployeeGeneralInfo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            this.Cursor = Cursors.Default;
            Application.UseWaitCursor = false;
        }
예제 #9
0
        public void ProcessRequest(System.Web.HttpContext Context)
        {
            bool Connect = false;
            int  Chunk   = 0;
            int  Chunks  = 0;

            if (AppCommon.LoginAuth("Web") == false)
            {
                Context.Session.Abandon();
                return;
            }

            Context.Response.ContentType = "text/plain";

            if (Context.Request.Form.AllKeys.Any(Mode => Mode == "chunk"))
            {
                if (Base.Common.IsNumeric(Context.Request.Form["Chunk"]) == true)
                {
                    Chunk = Context.Request.Form["Chunk"].TypeInt();
                }
                else
                {
                    return;
                }

                if (Base.Common.IsNumeric(Context.Request.Form["Chunks"]) == true)
                {
                    Chunks = Context.Request.Form["Chunks"].TypeInt();
                }
                else
                {
                    return;
                }

                if (Chunk == Chunks - 1)
                {
                    Connect = true;
                }
                else
                {
                    Connect = false;
                }
            }
            else
            {
                Connect = true;
            }

            if (Connect == true)
            {
                Conn = Base.Data.DBConnection(ConfigurationManager.AppSettings["ConnectionString"].TypeString());

                Conn.Open();
            }

            Upload(Context);

            if (Connect == true)
            {
                Conn.Close();
                Conn.Dispose();
            }
        }
예제 #10
0
        /// <summary>
        /// 文件批量移动
        /// </summary>
        private void MoveAll(HttpContext Context)
        {
            Hashtable FileTable      = new Hashtable();
            int       Id             = 0;
            string    FolderPath     = "";
            string    CodeId         = "";
            string    Name           = "";
            string    Extension      = "";
            int       FolderId       = 0;
            string    FolderIdPath   = "";
            string    FolderNewName  = "";
            int       FolderUserId   = 0;
            string    FolderUsername = "";
            int       FolderShare    = 0;
            int       FolderSync     = 0;
            string    SourceFilePath = "";
            string    TargetFilePath = "";
            int       Index          = 0;

            if (Context.Request.Form.GetValues("Id").Length == 0)
            {
                return;
            }

            if (Base.Common.IsNumeric(Context.Request.Form["FolderId"]) == true)
            {
                FolderId = Context.Request.Form["FolderId"].TypeInt();
            }
            else
            {
                return;
            }

            if (FolderId == 0)
            {
                FolderIdPath   = "/0/";
                FolderUserId   = Context.Session["UserId"].TypeInt();
                FolderUsername = Context.Session["Username"].TypeString();
            }
            else
            {
                FolderIdPath = AppCommon.FolderIdPath(FolderId, ref Conn);

                if (AppCommon.PurviewCheck(FolderId, true, "uploader", ref Conn) == false)
                {
                    Context.Response.Write("no-permission");
                    return;
                }

                Base.Data.SqlDataToTable("Select DBS_Id, DBS_UserId, DBS_Username, DBS_Folder, DBS_Share, DBS_Lock, DBS_Sync From DBS_File Where DBS_Folder = 1 And DBS_Lock = 0 And DBS_Id = " + FolderId, ref Conn, ref FileTable);

                if (FileTable["Exist"].TypeBool() == false)
                {
                    return;
                }
                else
                {
                    FolderUserId   = FileTable["DBS_UserId"].TypeInt();
                    FolderUsername = FileTable["DBS_Username"].TypeString();
                    FolderShare    = FileTable["DBS_Share"].TypeInt();
                    FolderSync     = FileTable["DBS_Sync"].TypeInt();
                }

                FileTable.Clear();
            }

            for (Index = 0; Index < Context.Request.Form.GetValues("Id").Length; Index++)
            {
                if (Base.Common.IsNumeric(Context.Request.Form.GetValues("Id")[Index]) == true)
                {
                    Id = Context.Request.Form.GetValues("Id")[Index].TypeInt();
                }
                else
                {
                    continue;
                }

                if (AppCommon.PurviewCheck(Id, false, "manager", ref Conn) == false)
                {
                    continue;
                }

                Base.Data.SqlDataToTable("Select DBS_Id, DBS_Folder, DBS_FolderId, DBS_FolderPath, DBS_CodeId, DBS_Name, DBS_Extension, DBS_Lock From DBS_File Where DBS_Folder = 0 And DBS_Lock = 0 And DBS_Id = " + Id, ref Conn, ref FileTable);

                if (FileTable["Exist"].TypeBool() == false)
                {
                    continue;
                }
                else
                {
                    FolderPath = FileTable["DBS_FolderPath"].TypeString();
                    CodeId     = FileTable["DBS_CodeId"].TypeString();
                    Name       = FileTable["DBS_Name"].TypeString();
                    Extension  = FileTable["DBS_Extension"].TypeString();
                }

                if (FileTable["DBS_FolderId"].TypeInt() == FolderId)
                {
                    continue;
                }

                FileTable.Clear();

                FolderNewName = AppCommon.FileName(FolderId, Name, Extension, ref Conn);

                SourceFilePath = Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), FolderPath.Substring(1), CodeId + Extension);

                TargetFilePath = Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), FolderIdPath.Substring(1), CodeId + Extension);

                if (File.Exists(SourceFilePath) == false)
                {
                    continue;
                }
                else
                {
                    File.Move(SourceFilePath, TargetFilePath);

                    if (File.Exists("" + SourceFilePath + ".pdf") == true)
                    {
                        File.Move("" + SourceFilePath + ".pdf", "" + TargetFilePath + ".pdf");
                    }

                    if (File.Exists("" + SourceFilePath + ".flv") == true)
                    {
                        File.Move("" + SourceFilePath + ".flv", "" + TargetFilePath + ".flv");
                    }
                }

                Base.Data.SqlQuery("Update DBS_File Set DBS_UserId = " + FolderUserId + ", DBS_Username = '******', DBS_FolderId = " + FolderId + ", DBS_FolderPath = '" + FolderIdPath + "', DBS_Name = '" + FolderNewName + "', DBS_Share = " + FolderShare + ", DBS_Sync = " + FolderSync + " Where DBS_Id = " + Id, ref Conn);

                Move_Version(Id, FolderPath, FolderId, FolderIdPath, FolderUserId, FolderUsername, FolderShare, FolderSync, Context);

                AppCommon.Log(Id, "file-move", ref Conn);
            }

            Context.Response.Write("complete");
        }
예제 #11
0
        /// <summary>
        /// F8 リボン 印刷
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF8Key(object sender, KeyEventArgs e)
        {
            PrinterDriver ret2 = AppCommon.GetPrinter(frmcfg.PrinterName);

            if (ret2.Result == false)
            {
                this.ErrorMessage = "プリンタドライバーがインストールされていません!";
                return;
            }
            frmcfg.PrinterName = ret2.PrinterName;


            if (!base.CheckAllValidation())
            {
                MessageBox.Show("入力内容に誤りがあります。");
                SetFocusToTopControl();
                return;
            }

            //作成締日
            if (作成締日 == null)
            {
                this.ErrorMessage = "作成締日は入力必須項目です。";
                MessageBox.Show("作成締日は入力必須項目です。");
                return;
            }

            //作成年月
            if (作成年 == null || 作成月 == null)
            {
                this.ErrorMessage = "作成年月は入力必須項目です。";
                MessageBox.Show("作成年月は入力必須項目です。");
                return;
            }

            //集計期間
            if (集計期間From == null || 集計期間To == null)
            {
                this.ErrorMessage = "集計期間は入力必須項目です。";
                MessageBox.Show("集計期間は入力必須項目です。");
                return;
            }


            string 年度 = Convert.ToString(作成月) + "月度支払書";

            int?[] i車輌List = new int?[0];
            if (!string.IsNullOrEmpty(車輌ピックアップ))
            {
                string[] 車輌List = 車輌ピックアップ.Split(',');
                i車輌List = new int?[車輌List.Length];

                for (int i = 0; i < 車輌List.Length; i++)
                {
                    string str = 車輌List[i];
                    int    code;
                    if (!int.TryParse(str, out code))
                    {
                        this.ErrorMessage = "車輌指定の形式が不正です。";
                        return;
                    }
                    i車輌List[i] = code;
                }
            }

            //帳票出力用
            base.SendRequest(new CommunicationObject(MessageType.RequestDataWithBusy, SEARCH_SRY03010, new object[] { 車輌From, 車輌To, i車輌List, 作成締日, 集計期間From, 集計期間To, 年度, 車輌ピックアップ }));
        }
예제 #12
0
        /// <summary>
        /// 文件复制
        /// </summary>
        private void Copy(HttpContext Context)
        {
            Hashtable FileTable = new Hashtable();

            byte[] Bytes          = {};
            int    Id             = 0;
            string FolderPath     = "";
            string CodeId         = "";
            string Name           = "";
            string Extension      = "";
            int    FolderId       = 0;
            string FolderIdPath   = "";
            int    FolderUserId   = 0;
            string FolderUsername = "";
            int    FolderShare    = 0;
            int    FolderSync     = 0;
            int    NewId          = 0;
            string NewCodeId      = "";
            string NewName        = "";
            string SourceFilePath = "";
            string TargetFilePath = "";
            string Sql            = "";

            if (Base.Common.IsNumeric(Context.Request.Form["Id"]) == true)
            {
                Id = Context.Request.Form["Id"].TypeInt();
            }
            else
            {
                return;
            }

            if (Base.Common.IsNumeric(Context.Request.Form["FolderId"]) == true)
            {
                FolderId = Context.Request.Form["FolderId"].TypeInt();
            }
            else
            {
                return;
            }

            if (AppCommon.PurviewCheck(Id, false, "editor", ref Conn) == false)
            {
                Context.Response.Write("no-permission");
                return;
            }

            Base.Data.SqlDataToTable("Select DBS_Id, DBS_Folder, DBS_FolderId, DBS_FolderPath, DBS_CodeId, DBS_Name, DBS_Extension, DBS_Lock From DBS_File Where DBS_Folder = 0 And DBS_Lock = 0 And DBS_Id = " + Id, ref Conn, ref FileTable);

            if (FileTable["Exist"].TypeBool() == false)
            {
                return;
            }
            else
            {
                FolderPath = FileTable["DBS_FolderPath"].TypeString();
                CodeId     = FileTable["DBS_CodeId"].TypeString();
                Name       = FileTable["DBS_Name"].TypeString();
                Extension  = FileTable["DBS_Extension"].TypeString();
            }

            FileTable.Clear();

            if (FolderId == 0)
            {
                FolderIdPath   = "/0/";
                FolderUserId   = Context.Session["UserId"].TypeInt();
                FolderUsername = Context.Session["Username"].TypeString();
            }
            else
            {
                FolderIdPath = AppCommon.FolderIdPath(FolderId, ref Conn);

                if (AppCommon.PurviewCheck(FolderId, true, "uploader", ref Conn) == false)
                {
                    Context.Response.Write("no-permission");
                    return;
                }

                Base.Data.SqlDataToTable("Select DBS_Id, DBS_UserId, DBS_Username, DBS_Folder, DBS_Share, DBS_Lock, DBS_Sync From DBS_File Where DBS_Folder = 1 And DBS_Lock = 0 And DBS_Id = " + FolderId, ref Conn, ref FileTable);

                if (FileTable["Exist"].TypeBool() == false)
                {
                    return;
                }
                else
                {
                    FolderUserId   = FileTable["DBS_UserId"].TypeInt();
                    FolderUsername = FileTable["DBS_Username"].TypeString();
                    FolderShare    = FileTable["DBS_Share"].TypeInt();
                    FolderSync     = FileTable["DBS_Sync"].TypeInt();
                }

                FileTable.Clear();
            }

            NewCodeId = AppCommon.CodeId();

            NewName = AppCommon.FileName(FolderId, Name, Extension, ref Conn);

            SourceFilePath = Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), FolderPath.Substring(1), CodeId + Extension);

            TargetFilePath = Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), FolderIdPath.Substring(1), NewCodeId + Extension);

            if (File.Exists(SourceFilePath) == false)
            {
                return;
            }
            else
            {
                Bytes = Base.Crypto.FileDecrypt(SourceFilePath, CodeId, true, false, true);

                if (Base.Common.IsNothing(Bytes) == true)
                {
                    return;
                }
                else
                {
                    File.WriteAllBytes(TargetFilePath, Bytes);
                }
            }

            Sql  = "Insert Into DBS_File(DBS_UserId, DBS_Username, DBS_Version, DBS_VersionId, DBS_Folder, DBS_FolderId, DBS_FolderPath, DBS_CodeId, DBS_Hash, DBS_Name, DBS_Extension, DBS_Size, DBS_Type, DBS_Remark, DBS_Share, DBS_Lock, DBS_Sync, DBS_Recycle, DBS_CreateUsername, DBS_CreateTime, DBS_UpdateUsername, DBS_UpdateTime, DBS_RemoveUsername, DBS_RemoveTime) ";
            Sql += "Select DBS_UserId, DBS_Username, 1, 0, 0, " + FolderId + ", '" + FolderIdPath + "', '" + NewCodeId + "', DBS_Hash, '" + NewName + "', DBS_Extension, DBS_Size, DBS_Type, 'null', " + FolderShare + ", 0, " + FolderSync + ", 0, '" + Context.Session["Username"].TypeString() + "', '" + DateTime.Now.ToString() + "', '" + Context.Session["Username"].TypeString() + "', '" + DateTime.Now.ToString() + "', 'null', '1970/1/1 00:00:00' From DBS_File Where DBS_Id = " + Id;

            NewId = Base.Data.SqlInsert(Sql, ref Conn);

            if (NewId == 0)
            {
                return;
            }

            Base.Data.SqlQuery("Insert Into DBS_File_Process(DBS_FileId, DBS_Convert, DBS_Index) Values(" + NewId + ", 1, 'add')", ref Conn);

            AppCommon.FileProcessTrigger();

            AppCommon.Log(NewId, "file-copy", ref Conn);

            Context.Response.Write("complete");
        }
예제 #13
0
        public void ProcessRequest(HttpContext Context)
        {
            if (AppCommon.LoginAuth("Web") == false)
            {
                Context.Session.Abandon();
                return;
            }

            Conn = Base.Data.DBConnection(ConfigurationManager.AppSettings["ConnectionString"].TypeString());

            Conn.Open();

            switch (Context.Request.QueryString["Action"].TypeString())
            {
            case "rename":
                Rename(Context);
                break;

            case "remark":
                Remark(Context);
                break;

            case "lock":
                Lock(Context);
                break;

            case "unlock":
                Unlock(Context);
                break;

            case "replace":
                Replace(Context);
                break;

            case "copy":
                Copy(Context);
                break;

            case "move":
                Move(Context);
                break;

            case "moveall":
                MoveAll(Context);
                break;

            case "remove":
                Remove(Context);
                break;

            case "removeall":
                RemoveAll(Context);
                break;

            case "restore":
                Restore(Context);
                break;

            case "restoreall":
                RestoreAll(Context);
                break;

            case "delete":
                Delete(Context);
                break;

            case "deleteall":
                DeleteAll(Context);
                break;
            }

            Conn.Close();
            Conn.Dispose();
        }
예제 #14
0
        /// <summary>
        /// 文件替换(版本)
        /// </summary>
        private void Replace(HttpContext Context)
        {
            Hashtable FileTable             = new Hashtable();
            int       Id                    = 0;
            int       VersionId             = 0;
            int       CurrentVersion        = 0;
            string    CurrentCodeId         = "";
            string    CurrentHash           = "";
            int       CurrentSize           = 0;
            string    CurrentRemark         = "";
            string    CurrentUpdateUsername = "";
            string    CurrentUpdateTime     = "";
            int       ReplaceVersion        = 0;
            string    ReplaceCodeId         = "";
            string    ReplaceHash           = "";
            int       ReplaceSize           = 0;
            string    ReplaceRemark         = "";
            string    ReplaceUpdateUsername = "";
            string    ReplaceUpdateTime     = "";

            if (Base.Common.IsNumeric(Context.Request.Form["Id"]) == true)
            {
                Id = Context.Request.Form["Id"].TypeInt();
            }
            else
            {
                return;
            }

            if (Base.Common.IsNumeric(Context.Request.Form["VersionId"]) == true)
            {
                VersionId = Context.Request.Form["VersionId"].TypeInt();
            }
            else
            {
                return;
            }

            if (AppCommon.PurviewCheck(Id, false, "creator", ref Conn) == false)
            {
                Context.Response.Write("no-permission");
                return;
            }

            // 读取当前版本信息
            Base.Data.SqlDataToTable("Select DBS_Id, DBS_Version, DBS_VersionId, DBS_Folder, DBS_CodeId, DBS_Hash, DBS_Size, DBS_Remark, DBS_Lock, DBS_UpdateUsername, DBS_UpdateTime From DBS_File Where DBS_VersionId = 0 And DBS_Folder = 0 And DBS_Lock = 0 And DBS_Id = " + Id, ref Conn, ref FileTable);

            if (FileTable["Exist"].TypeBool() == false)
            {
                return;
            }
            else
            {
                CurrentVersion        = FileTable["DBS_Version"].TypeInt();
                CurrentCodeId         = FileTable["DBS_CodeId"].TypeString();
                CurrentHash           = FileTable["DBS_Hash"].TypeString();
                CurrentSize           = FileTable["DBS_Size"].TypeInt();
                CurrentRemark         = FileTable["DBS_Remark"].TypeString();
                CurrentUpdateUsername = FileTable["DBS_UpdateUsername"].TypeString();
                CurrentUpdateTime     = FileTable["DBS_UpdateTime"].TypeString();
            }

            FileTable.Clear();

            // 读取替换版本信息
            Base.Data.SqlDataToTable("Select DBS_Id, DBS_Version, DBS_VersionId, DBS_Folder, DBS_CodeId, DBS_Hash, DBS_Size, DBS_Remark, DBS_Lock, DBS_UpdateUsername, DBS_UpdateTime From DBS_File Where DBS_VersionId = " + Id + " And DBS_Folder = 0 And DBS_Lock = 0 And DBS_Id = " + VersionId, ref Conn, ref FileTable);

            if (FileTable["Exist"].TypeBool() == false)
            {
                return;
            }
            else
            {
                ReplaceVersion        = FileTable["DBS_Version"].TypeInt();
                ReplaceCodeId         = FileTable["DBS_CodeId"].TypeString();
                ReplaceHash           = FileTable["DBS_Hash"].TypeString();
                ReplaceSize           = FileTable["DBS_Size"].TypeInt();
                ReplaceRemark         = FileTable["DBS_Remark"].TypeString();
                ReplaceUpdateUsername = FileTable["DBS_UpdateUsername"].TypeString();
                ReplaceUpdateTime     = FileTable["DBS_UpdateTime"].TypeString();
            }

            FileTable.Clear();

            Base.Data.SqlQuery("Update DBS_File Set DBS_Version = " + CurrentVersion + ", DBS_CodeId = '" + CurrentCodeId + "', DBS_Hash = '" + CurrentHash + "', DBS_Size = " + CurrentSize + ", DBS_Remark = '" + CurrentRemark + "', DBS_UpdateUsername = '******', DBS_UpdateTime = '" + CurrentUpdateTime + "' Where DBS_Id = " + VersionId, ref Conn);
            Base.Data.SqlQuery("Update DBS_File Set DBS_Version = " + ReplaceVersion + ", DBS_CodeId = '" + ReplaceCodeId + "', DBS_Hash = '" + ReplaceHash + "', DBS_Size = " + ReplaceSize + ", DBS_Remark = '" + ReplaceRemark + "', DBS_UpdateUsername = '******', DBS_UpdateTime = '" + ReplaceUpdateTime + "' Where DBS_Id = " + Id, ref Conn);

            Base.Data.SqlQuery("Update DBS_File_Process Set DBS_Index = 'update' Where DBS_FileId = " + Id, ref Conn);

            AppCommon.Log(VersionId, "file-replace", ref Conn);

            Context.Response.Write("complete");
        }
        /// <summary>
        /// Main running method for the application.
        /// </summary>
        /// <param name="args">Commandline arguments to the application.</param>
        /// <returns>Returns the application error code.</returns>
        private int Run(string[] args)
        {
            try
            {
                // parse the command line
                this.ParseCommandLine(args);

                // exit if there was an error parsing the command line (otherwise the logo appears after error messages)
                if (Messaging.Instance.EncounteredError)
                {
                    return(Messaging.Instance.LastErrorNumber);
                }

                if (this.showLogo)
                {
                    AppCommon.DisplayToolHeader();
                }

                if (this.showHelp)
                {
                    Console.WriteLine(LuxStrings.HelpMessage);
                    AppCommon.DisplayToolFooter();
                    return(Messaging.Instance.LastErrorNumber);
                }

                foreach (string parameter in this.invalidArgs)
                {
                    Messaging.Instance.OnMessage(WixWarnings.UnsupportedCommandLineArgument(parameter));
                }

                this.invalidArgs = null;

                // gotta have something to do
                if (0 == this.inputFiles.Count || String.IsNullOrEmpty(this.outputFile))
                {
                    Console.WriteLine(LuxStrings.HelpMessage);
                    Messaging.Instance.OnMessage(LuxBuildErrors.MalfunctionNeedInput());
                    return(Messaging.Instance.LastErrorNumber);
                }

                if (String.IsNullOrEmpty(Path.GetExtension(this.outputFile)))
                {
                    this.outputFile = Path.ChangeExtension(this.outputFile, ".wxs");
                }

                // get extensions from lux.exe.config
                AppCommon.ReadConfiguration(this.extensionList);

                Generator.Generate(this.extensionList, this.inputFiles, this.outputFile);
            }
            catch (WixException we)
            {
                Messaging.Instance.OnMessage(we.Error);
            }
            catch (Exception e)
            {
                Messaging.Instance.OnMessage(WixErrors.UnexpectedException(e.Message, e.GetType().ToString(), e.StackTrace));
                if (e is NullReferenceException || e is SEHException)
                {
                    throw;
                }
            }

            return(Messaging.Instance.LastErrorNumber);
        }
예제 #16
0
        /// <summary>
        /// 文件版本上传
        /// </summary>
        private void Upload(HttpContext Context)
        {
            Hashtable      FileTable  = new Hashtable();
            HttpPostedFile UploadFile = default(HttpPostedFile);
            FileStream     FileStream = default(FileStream);
            Stream         Stream     = default(Stream);

            byte[] ByteBuffer      = {};
            int    ByteRead        = 0;
            int    Chunk           = 0;
            int    Chunks          = 0;
            string Guid            = "";
            int    FileId          = 0;
            string Remark          = "";
            string FolderPath      = "";
            string Name            = "";
            string Extension       = "";
            string FileName        = "";
            string FileExtension   = "";
            int    FileSize        = 0;
            string TempStoragePath = "";
            string TempFilePath    = "";
            string SaveStoragePath = "";
            string SaveFilePath    = "";
            int    NewId           = 0;
            int    NewVersion      = 0;
            string NewCodeId       = "";
            string NewHash         = "";
            int    VersionCount    = 0;
            string Sql             = "";

            try
            {
                if (Base.Common.IsNumeric(Context.Request.Form["Chunk"]) == true)
                {
                    Chunk = Context.Request.Form["Chunk"].TypeInt();
                }
                else
                {
                    return;
                }

                if (Base.Common.IsNumeric(Context.Request.Form["Chunks"]) == true)
                {
                    Chunks = Context.Request.Form["Chunks"].TypeInt();
                }
                else
                {
                    return;
                }

                Guid = Context.Request.Form["Guid"].TypeString();

                if (Base.Common.StringCheck(Guid, @"^[\d\.]+$") == false)
                {
                    return;
                }

                if (Base.Common.IsNumeric(Context.Request.Form["FileId"]) == true)
                {
                    FileId = Context.Request.Form["FileId"].TypeInt();
                }
                else
                {
                    return;
                }

                Remark = Base.Common.InputFilter(Context.Request.Form["Remark"].TypeString());

                if (string.IsNullOrEmpty(Remark) == false)
                {
                    if (Base.Common.StringCheck(Remark, @"^[\s\S]{1,100}$") == false)
                    {
                        return;
                    }
                }

                UploadFile = Context.Request.Files[0];

                if (Base.Common.IsNothing(UploadFile) == true || string.IsNullOrEmpty(UploadFile.FileName) == true || UploadFile.ContentLength == 0)
                {
                    return;
                }

                FileName = Path.GetFileNameWithoutExtension(UploadFile.FileName);

                FileExtension = Path.GetExtension(UploadFile.FileName).ToString().ToLower();

                if (Base.Common.IsNumeric(Context.Request.Form["Size"]) == true)
                {
                    FileSize = Context.Request.Form["Size"].TypeInt();
                }
                else
                {
                    return;
                }

                if (FileSize > ConfigurationManager.AppSettings["UploadSize"].TypeInt() * 1024 * 1024)
                {
                    return;
                }

                TempStoragePath = Context.Server.MapPath("/storage/file/temp/");

                TempFilePath = Base.Common.PathCombine(TempStoragePath, Guid);

                Stream = UploadFile.InputStream;

                FileStream = new FileStream(TempFilePath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite, 4096, true);

                ByteBuffer = new byte[(int)Stream.Length];

                ByteRead = Stream.Read(ByteBuffer, 0, (int)Stream.Length);

                FileStream.Write(ByteBuffer, 0, ByteRead);

                FileStream.Close();
                FileStream.Dispose();
                Stream.Close();
                Stream.Dispose();

                if (Chunk == (Chunks == 0 ? 0 : Chunks - 1))
                {
                    if (AppCommon.PurviewCheck(FileId, false, "editor", ref Conn) == false)
                    {
                        return;
                    }

                    Base.Data.SqlDataToTable("Select DBS_Id, DBS_Folder, DBS_FolderPath, DBS_CodeId, DBS_Name, DBS_Extension, DBS_Lock, DBS_Recycle From DBS_File Where DBS_Folder = 0 And DBS_Lock = 0 And DBS_Recycle = 0 And DBS_Id = " + FileId, ref Conn, ref FileTable);

                    if (FileTable["Exist"].TypeBool() == false)
                    {
                        return;
                    }
                    else
                    {
                        FolderPath = FileTable["DBS_FolderPath"].TypeString();
                        Name       = FileTable["DBS_Name"].TypeString();
                        Extension  = FileTable["DBS_Extension"].TypeString();
                    }

                    FileTable.Clear();

                    if (Extension != FileExtension)
                    {
                        return;
                    }

                    NewVersion = AppCommon.FileVersionNumber(FileId, ref Conn);

                    NewCodeId = AppCommon.CodeId();

                    SaveStoragePath = Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), FolderPath.Substring(1));

                    SaveFilePath = Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), FolderPath.Substring(1), NewCodeId + FileExtension);

                    if (File.Exists(TempFilePath) == false)
                    {
                        return;
                    }
                    else
                    {
                        File.Move(TempFilePath, SaveFilePath);
                    }

                    VersionCount = Base.Data.SqlScalar("Select Count(*) From DBS_File Where DBS_VersionId = " + FileId, ref Conn);

                    // 文件旧版本清理
                    if (VersionCount >= ConfigurationManager.AppSettings["VersionCount"].TypeInt())
                    {
                        AppCommon.FileVersionCleanup(FileId, ref Conn);
                    }

                    NewHash = AppCommon.FileHash(SaveFilePath);

                    Sql  = "Insert Into DBS_File(DBS_UserId, DBS_Username, DBS_Version, DBS_VersionId, DBS_Folder, DBS_FolderId, DBS_FolderPath, DBS_CodeId, DBS_Hash, DBS_Name, DBS_Extension, DBS_Size, DBS_Type, DBS_Remark, DBS_Share, DBS_Lock, DBS_Sync, DBS_Recycle, DBS_CreateUsername, DBS_CreateTime, DBS_UpdateUsername, DBS_UpdateTime, DBS_RemoveUsername, DBS_RemoveTime) ";
                    Sql += "Select DBS_UserId, DBS_Username, " + NewVersion + ", " + FileId + ", DBS_Folder, DBS_FolderId, DBS_FolderPath, '" + NewCodeId + "', '" + NewHash + "', '" + Name + "', DBS_Extension, " + FileSize + ", DBS_Type, '" + Remark + "', DBS_Share, DBS_Lock, DBS_Sync, DBS_Recycle, DBS_CreateUsername, DBS_CreateTime, '" + Context.Session["Username"].TypeString() + "', '" + DateTime.Now.ToString() + "', DBS_RemoveUsername, DBS_RemoveTime From DBS_File Where DBS_Id = " + FileId;

                    NewId = Base.Data.SqlInsert(Sql, ref Conn);

                    if (NewId == 0)
                    {
                        return;
                    }

                    Base.Data.SqlQuery("Insert Into DBS_File_Process(DBS_FileId, DBS_Convert, DBS_Index) Values(" + NewId + ", 1, 'null')", ref Conn);

                    AppCommon.FileProcessTrigger();

                    AppCommon.Log(NewId, "file-upversion", ref Conn);
                }

                Context.Response.Write("success");
            }
            catch (Exception ex)
            {
                File.Delete(TempFilePath);

                AppCommon.Error(ex);

                Context.Response.Write(ex.Message);
            }
            finally
            {
                if (Base.Common.IsNothing(FileStream) == false)
                {
                    FileStream.Close();
                    FileStream.Dispose();
                }

                if (Base.Common.IsNothing(Stream) == false)
                {
                    Stream.Close();
                    Stream.Dispose();
                }

                GC.Collect();
                GC.WaitForPendingFinalizers();
            }
        }
예제 #17
0
        /// <summary>
        /// F8 リボン 印刷
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF8Key(object sender, KeyEventArgs e)
        {
            PrinterDriver ret = AppCommon.GetPrinter(frmcfg.PrinterName);

            if (ret.Result == false)
            {
                this.ErrorMessage = "プリンタドライバーがインストールされていません!";
                return;
            }
            frmcfg.PrinterName = ret.PrinterName;


            if (!base.CheckAllValidation())
            {
                MessageBox.Show("入力内容に誤りがあります。");
                SetFocusToTopControl();
                return;
            }

            //作成区分のインデックス値取得
            int 作成区分;

            作成区分 = 作成区分_Cmb.SelectedIndex;

            //作成年月度
            string s作成年月度 = Convert.ToString(作成年 + "年" + 作成月 + "月度");

            //締日が0 or 31を超える場合
            //if (!string.IsNullOrEmpty(作成集金日))
            //{
            //    if (AppCommon.IntParse(作成集金日) == 0 || AppCommon.IntParse(作成集金日) > 31)
            //    {
            //        this.ErrorMessage = "締日は1~31の間で入力してください。末締は月に関らず31日と入力してください。";
            //        MessageBox.Show("締日は1~31の間で入力してください。\r\n末締は月に関らず31日と入力してください。");
            //        return;
            //    }
            //}
            //else
            //{
            //    Zensimebi.IsChecked = true;
            //}



            if (!string.IsNullOrEmpty(作成集金日) && 全集金日集計 == true)
            {
                this.ErrorMessage = "作成集金日、全集金日は同時に入力できません。";
                MessageBox.Show("作成集金日、全集金日は同時に入力できません。");
                return;
            }
            else if (string.IsNullOrEmpty(作成集金日) && 全集金日集計 == false)
            {
                this.ErrorMessage = "作成集金日、全集金日を入力してください。";
                MessageBox.Show("作成集金日、全集金日を入力してください。");
                return;
            }

            //作成日付
            if (string.IsNullOrEmpty(作成年) || string.IsNullOrEmpty(作成月))
            {
                this.ErrorMessage = "作成年月は入力必須項目です。";
                MessageBox.Show("作成年月は入力必須項目です。");
                return;
            }


            int?[] i得意先List = new int?[0];
            if (!string.IsNullOrEmpty(得意先ピックアップ))
            {
                string[] 得意先List = 得意先ピックアップ.Split(',');
                i得意先List = new int?[得意先List.Length];

                for (int i = 0; i < 得意先List.Length; i++)
                {
                    string str = 得意先List[i];
                    int    code;
                    if (!int.TryParse(str, out code))
                    {
                        this.ErrorMessage = "得意先指定の形式が不正です。";
                        return;
                    }
                    i得意先List[i] = code;
                }
            }

            base.SendRequest(new CommunicationObject(MessageType.RequestDataWithBusy, SEARCH_TKS10010, new object[] { 得意先From, 得意先To, i得意先List, 作成集金日, 全集金日集計, 作成年, 作成月, 作成区分, s作成年月度 }));
        }
예제 #18
0
        /// <summary>
        /// Main running method for the application.
        /// </summary>
        /// <param name="args">Commandline arguments to the application.</param>
        /// <returns>Returns the application error code.</returns>
        private int Run(string[] args)
        {
            try
            {
                // parse the command line
                this.ParseCommandLine(args);

                // exit if there was an error parsing the command line (otherwise the logo appears after error messages)
                if (this.messageHandler.EncounteredError)
                {
                    return(this.messageHandler.LastErrorNumber);
                }

                if (null == this.inputFile || null == this.outputFile)
                {
                    this.showHelp = true;
                }

                if (this.showLogo)
                {
                    AppCommon.DisplayToolHeader();
                }

                if (this.showHelp)
                {
                    Console.WriteLine(PyroStrings.HelpMessage);
                    AppCommon.DisplayToolFooter();
                    return(this.messageHandler.LastErrorNumber);
                }

                foreach (string parameter in this.invalidArgs)
                {
                    this.messageHandler.Display(this, WixWarnings.UnsupportedCommandLineArgument(parameter));
                }
                this.invalidArgs = null;

                // Load in transforms
                ArrayList transforms = new ArrayList();
                foreach (string inputTransform in inputTransformsOrdered)
                {
                    PatchTransform patchTransform = new PatchTransform(inputTransform, inputTransforms[inputTransform]);
                    patchTransform.Message += new MessageEventHandler(this.messageHandler.Display);
                    transforms.Add(patchTransform);
                }

                // Create and configure the patch
                Patch patch = new Patch();
                patch.Message += new MessageEventHandler(this.messageHandler.Display);

                // Create and configure the binder
                binder = new Microsoft.Tools.WindowsInstallerXml.Binder();
                binder.TempFilesLocation             = Environment.GetEnvironmentVariable("WIX_TEMP");
                binder.WixVariableResolver           = this.wixVariableResolver;
                binder.Message                      += new MessageEventHandler(this.messageHandler.Display);
                binder.SuppressAssemblies            = this.suppressAssemblies;
                binder.SuppressFileHashAndInfo       = this.suppressFileHashAndInfo;
                binder.SetMsiAssemblyNameFileVersion = this.setAssemblyFileVersions;

                // Load the extensions
                bool binderFileManagerLoaded = false;
                foreach (String extension in this.extensions)
                {
                    WixExtension wixExtension = WixExtension.Load(extension);
                    binder.AddExtension(wixExtension);
                    patch.AddExtension(wixExtension);

                    if (null != wixExtension.BinderFileManager)
                    {
                        if (binderFileManagerLoaded)
                        {
                            throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, PyroStrings.EXP_CannotLoadBinderFileManager, wixExtension.BinderFileManager.GetType().ToString(), binder.FileManager.ToString()), "ext");
                        }

                        binder.FileManager      = wixExtension.BinderFileManager;
                        binderFileManagerLoaded = true;
                    }
                }

                // since the binder is now ready, let's plug dynamic bindpath into file manager
                this.PrepareDataForFileManager();

                // Load the patch
                patch.Load(this.inputFile);

                // Copy transforms into output
                if (0 < transforms.Count)
                {
                    patch.AttachTransforms(transforms);
                }

                if (this.messageHandler.EncounteredError)
                {
                    return(this.messageHandler.LastErrorNumber);
                }

                if (null == this.pdbFile && null != this.outputFile)
                {
                    this.pdbFile = Path.ChangeExtension(this.outputFile, ".wixpdb");
                }

                binder.PdbFile = suppressWixPdb ? null : this.pdbFile;

                if (this.suppressFiles)
                {
                    binder.SuppressAssemblies      = true;
                    binder.SuppressFileHashAndInfo = true;
                }

                if (null != this.cabCachePath || this.reuseCabinets)
                {
                    // ensure the cabinet cache path exists if we are going to use it
                    if (null != this.cabCachePath && !Directory.Exists(this.cabCachePath))
                    {
                        Directory.CreateDirectory(this.cabCachePath);
                    }
                }

                binder.FileManager.ReuseCabinets    = this.reuseCabinets;
                binder.FileManager.CabCachePath     = this.cabCachePath;
                binder.FileManager.Output           = patch.PatchOutput;
                binder.FileManager.DeltaBinaryPatch = this.delta;

                // Bind the patch to an msp.
                binder.Bind(patch.PatchOutput, this.outputFile);
            }
            catch (WixException we)
            {
                this.OnMessage(we.Error);
            }
            catch (Exception e)
            {
                this.OnMessage(WixErrors.UnexpectedException(e.Message, e.GetType().ToString(), e.StackTrace));
                if (e is NullReferenceException || e is SEHException)
                {
                    throw;
                }
            }
            finally
            {
                if (null != binder)
                {
                    if (this.tidy)
                    {
                        if (!binder.DeleteTempFiles())
                        {
                            Console.WriteLine(PyroStrings.WAR_FailedToDeleteTempDir, binder.TempFilesLocation);
                        }
                    }
                    else
                    {
                        Console.WriteLine(PyroStrings.INF_TempDirLocatedAt, binder.TempFilesLocation);
                    }
                }
            }

            return(this.messageHandler.LastErrorNumber);
        }
예제 #19
0
        /// <summary>
        /// Loadイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            #region 設定項目取得
            ucfg = AppCommon.GetConfig(this);
            // 権限設定を呼び出す(ucfgを取得した後のに入れる)
            ccfg = (CommonConfig)ucfg.GetConfigValue(typeof(CommonConfig));
            // 登録ボタン設定
            if (!権限Get.Authority_Update_Button(ccfg, this.GetType().Name))
            {
                DataUpdateVisible = System.Windows.Visibility.Hidden;
            }
            frmcfg = (ConfigMST20010)ucfg.GetConfigValue(typeof(ConfigMST20010));
            if (frmcfg == null)
            {
                frmcfg = new ConfigMST20010();
                ucfg.SetConfigValue(frmcfg);
            }
            else
            {
                // 表示できるかチェック
                var WidthCHK = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - frmcfg.Left;
                if (WidthCHK > 10)
                {
                    this.Left = frmcfg.Left;
                }
                // 表示できるかチェック
                var HeightCHK = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height - frmcfg.Top;
                if (HeightCHK > 10)
                {
                    this.Top = frmcfg.Top;
                }
                this.Height = frmcfg.Height;
                this.Width  = frmcfg.Width;
            }
            #endregion

            ScreenClear();

            #region 遷移元からのパラメータを設定
            if (!string.IsNullOrEmpty(CustomerCode))
            {
                this.TOKUISAKI.Text1 = CustomerCode;
            }

            if (!string.IsNullOrEmpty(CustomerEda))
            {
                this.TOKUISAKI.Text2 = CustomerEda;
            }

            if (!string.IsNullOrEmpty(ItemNumber))
            {
                this.HINBAN.Text1 = ItemNumber;
            }

            if (!string.IsNullOrEmpty(ColorCode))
            {
                this.COLOR.Text1 = ColorCode;
            }

            #endregion

            switch (SendFormId)
            {
            case (int)SEND_FORM.取引先マスタ:
                this.HINBAN.Visibility = System.Windows.Visibility.Hidden;
                this.COLOR.Visibility  = System.Windows.Visibility.Hidden;
                break;

            case (int)SEND_FORM.品番マスタ:
                this.TOKUISAKI.Visibility          = System.Windows.Visibility.Hidden;
                this.Grid_ProductNumber.Visibility = System.Windows.Visibility.Hidden;
                this.Grid_ProductName.Visibility   = System.Windows.Visibility.Hidden;
                this.Grid_SupplierCode.Visibility  = System.Windows.Visibility.Visible;
                this.Grid_SupplierEda.Visibility   = System.Windows.Visibility.Visible;
                this.Grid_SupplierName.Visibility  = System.Windows.Visibility.Visible;
                break;

            default:
                break;
            }

            // 画面呼出し先定義
            base.MasterMaintenanceWindowList.Add("M01_TOK", new List <Type> {
                null, typeof(SCHM01_TOK)
            });
            base.MasterMaintenanceWindowList.Add("M16_HINGUN", new List <Type> {
                null, typeof(SCHM16_HINGUN)
            });
            base.MasterMaintenanceWindowList.Add("M09_MYHIN", new List <Type> {
                null, typeof(SCHM09_MYHIN)
            });
            base.MasterMaintenanceWindowList.Add("M06_IRO", new List <Type> {
                null, typeof(SCHM06_IRO)
            });

            if ((!string.IsNullOrEmpty(CustomerCode) && !string.IsNullOrEmpty(CustomerEda)) ||
                !string.IsNullOrEmpty(ItemNumber))
            {
                // 値が設定されている場合は自動でボタン押下処理を実行
                BtnStart_Click(sender, null);
            }

            setFiltterEvent(true);

            GetProductInfo();

            // 品群にフォーカスを設定
            this.HINGUN.Focus();
        }
예제 #20
0
        /// <summary>
        /// Parse the commandline arguments.
        /// </summary>
        /// <param name="args">Commandline arguments.</param>
        private void ParseCommandLine(string[] args)
        {
            for (int i = 0; i < args.Length; ++i)
            {
                string arg = args[i];

                // skip blank arguments
                if (null == arg || 0 == arg.Length)
                {
                    continue;
                }

                if ('-' == arg[0] || '/' == arg[0])
                {
                    string parameter = arg.Substring(1);

                    if ("cub" == parameter)
                    {
                        string cubeFile = CommandLine.GetFile(parameter, this.messageHandler, args, ++i);

                        if (String.IsNullOrEmpty(cubeFile))
                        {
                            return;
                        }

                        this.validator.AddCubeFile(cubeFile);
                    }
                    else if ("ext" == parameter)
                    {
                        if (!CommandLine.IsValidArg(args, ++i))
                        {
                            this.messageHandler.Display(this, WixErrors.TypeSpecificationForExtensionRequired("-ext"));
                            return;
                        }

                        this.extensionList.Add(args[i]);
                    }
                    else if (parameter.StartsWith("ice:"))
                    {
                        this.ices.Add(parameter.Substring(4));
                    }
                    else if ("pdb" == parameter)
                    {
                        this.pdbPath = CommandLine.GetFile(parameter, this.messageHandler, args, ++i);

                        if (String.IsNullOrEmpty(this.pdbPath))
                        {
                            return;
                        }
                    }
                    else if ("nodefault" == parameter)
                    {
                        this.addDefault = false;
                    }
                    else if ("nologo" == parameter)
                    {
                        this.showLogo = false;
                    }
                    else if ("notidy" == parameter)
                    {
                        this.tidy = false;
                    }
                    else if (parameter.StartsWith("sice:"))
                    {
                        this.suppressICEs.Add(parameter.Substring(5));
                    }
                    else if ("swall" == parameter)
                    {
                        this.messageHandler.Display(this, WixWarnings.DeprecatedCommandLineSwitch("swall", "sw"));
                        this.messageHandler.SuppressAllWarnings = true;
                    }
                    else if (parameter.StartsWith("sw"))
                    {
                        string paramArg = parameter.Substring(2);
                        try
                        {
                            if (0 == paramArg.Length)
                            {
                                this.messageHandler.SuppressAllWarnings = true;
                            }
                            else
                            {
                                int suppressWarning = Convert.ToInt32(paramArg, CultureInfo.InvariantCulture.NumberFormat);
                                if (0 >= suppressWarning)
                                {
                                    this.messageHandler.Display(this, WixErrors.IllegalSuppressWarningId(paramArg));
                                }

                                this.messageHandler.SuppressWarningMessage(suppressWarning);
                            }
                        }
                        catch (FormatException)
                        {
                            this.messageHandler.Display(this, WixErrors.IllegalSuppressWarningId(paramArg));
                        }
                        catch (OverflowException)
                        {
                            this.messageHandler.Display(this, WixErrors.IllegalSuppressWarningId(paramArg));
                        }
                    }
                    else if ("wxall" == parameter)
                    {
                        this.messageHandler.Display(this, WixWarnings.DeprecatedCommandLineSwitch("wxall", "wx"));
                        this.messageHandler.WarningAsError = true;
                    }
                    else if (parameter.StartsWith("wx"))
                    {
                        string paramArg = parameter.Substring(2);
                        try
                        {
                            if (0 == paramArg.Length)
                            {
                                this.messageHandler.WarningAsError = true;
                            }
                            else
                            {
                                int elevateWarning = Convert.ToInt32(paramArg, CultureInfo.InvariantCulture.NumberFormat);
                                if (0 >= elevateWarning)
                                {
                                    this.messageHandler.Display(this, WixErrors.IllegalWarningIdAsError(paramArg));
                                }

                                this.messageHandler.ElevateWarningMessage(elevateWarning);
                            }
                        }
                        catch (FormatException)
                        {
                            this.messageHandler.Display(this, WixErrors.IllegalWarningIdAsError(paramArg));
                        }
                        catch (OverflowException)
                        {
                            this.messageHandler.Display(this, WixErrors.IllegalWarningIdAsError(paramArg));
                        }
                    }
                    else if ("v" == parameter)
                    {
                        this.messageHandler.ShowVerboseMessages = true;
                    }
                    else if ("?" == parameter || "help" == parameter)
                    {
                        this.showHelp = true;
                        return;
                    }
                    else
                    {
                        this.invalidArgs.Add(parameter);
                    }
                }
                else if ('@' == arg[0])
                {
                    this.ParseCommandLine(CommandLineResponseFile.Parse(arg.Substring(1)));
                }
                else
                {
                    // Verify the file extension is an expected value
                    if (IsValidFileExtension(arg))
                    {
                        this.inputFiles.AddRange(AppCommon.GetFiles(arg, "Source"));
                    }
                }
            }
        }
예제 #21
0
        //作成月がNullの場合は今月の月を挿入
        private void Lost_Month(object sender, RoutedEventArgs e)
        {
            if (作成月 == null)
            {
                string   Date;
                int      iDate;
                DateTime MM;
                MM    = DateTime.Today;
                Date  = Convert.ToString(MM);
                Date  = Date.Substring(5, 2);
                iDate = Convert.ToInt32(Date);
                作成月   = iDate.ToString();
            }
            else
            {
                int?換月 = -1;
                if (!string.IsNullOrEmpty(作成月))
                {
                    換月 = AppCommon.IntParse(作成月);
                }
                //再入力処理
                if (換月 == 0)
                {
                    string   Date;
                    int      iDate;
                    DateTime MM;
                    MM    = DateTime.Today;
                    Date  = Convert.ToString(MM);
                    Date  = Date.Substring(5, 2);
                    iDate = Convert.ToInt32(Date);
                    作成月   = iDate.ToString();
                }
                //再入力時のエラー処理
                //初期値0ではエラー処理が通らないので-1をセット
                if (換月 < 1 || 換月 > 12)
                {
                    if (換月 == -1)
                    {
                        string   Date;
                        int      iDate;
                        DateTime MM;
                        MM    = DateTime.Today;
                        Date  = Convert.ToString(MM);
                        Date  = Date.Substring(5, 2);
                        iDate = Convert.ToInt32(Date);
                        作成月   = iDate.ToString();
                    }
                }
            }

            if (!string.IsNullOrEmpty(作成締日))
            {
                //締日入力時
                //メソッドで期間計算
                DateFromTo ret = AppCommon.GetDateFromTo(Convert.ToInt32(作成年), Convert.ToInt32(作成月), Convert.ToInt32(作成締日));
                if (ret.Result == false || ret.Kikan > 31)
                {
                    this.ErrorMessage = "入力値エラーです。もう一度入力してください。";
                    MessageBox.Show("入力値エラーです。もう一度入力してください。");
                    SetFocusToTopControl();
                    return;
                }
                集計期間From = ret.DATEFrom;
                集計期間To   = ret.DATETo;
            }
            else
            {
                //全締日選択時
                string   Date = 作成年.ToString() + "/" + 作成月.ToString() + "/" + 01;
                DateTime YYY, DDD;
                YYY      = Convert.ToDateTime(Date);
                DDD      = Convert.ToDateTime(Date);
                DDD      = DDD.AddMonths(+1).AddDays(-1);
                集計期間From = YYY;
                集計期間To   = DDD;
            }

            var yesno = MessageBox.Show("プレビューを表示しますか?", "確認", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes);

            if (yesno == MessageBoxResult.No)
            {
                return;
            }
            OnF8Key(sender, null);
        }
예제 #22
0
        /// <summary>
        /// Main running method for the application.
        /// </summary>
        /// <param name="args">Commandline arguments to the application.</param>
        /// <returns>Returns the application error code.</returns>
        private int Run(string[] args)
        {
            try
            {
                // parse the command line
                this.ParseCommandLine(args);

                // exit if there was an error parsing the command line (otherwise the logo appears after error messages)
                if (this.messageHandler.EncounteredError)
                {
                    return(this.messageHandler.LastErrorNumber);
                }

                if (0 == this.inputFiles.Count)
                {
                    this.showHelp = true;
                }

                if (this.showLogo)
                {
                    AppCommon.DisplayToolHeader();
                }

                if (this.showHelp)
                {
                    Console.WriteLine(SmokeStrings.HelpMessage);
                    AppCommon.DisplayToolFooter();
                    return(this.messageHandler.LastErrorNumber);
                }

                foreach (string parameter in this.invalidArgs)
                {
                    this.messageHandler.Display(this, WixWarnings.UnsupportedCommandLineArgument(parameter));
                }
                this.invalidArgs = null;

                validator.TempFilesLocation = Environment.GetEnvironmentVariable("WIX_TEMP");

                // load any extensions
                bool validatorExtensionLoaded = false;
                foreach (string extension in this.extensionList)
                {
                    WixExtension wixExtension = WixExtension.Load(extension);

                    ValidatorExtension validatorExtension = wixExtension.ValidatorExtension;
                    if (null != validatorExtension)
                    {
                        if (validatorExtensionLoaded)
                        {
                            throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, SmokeStrings.EXP_CannotLoadLinkerExtension, validatorExtension.GetType().ToString(), validator.Extension.ToString()), "ext");
                        }

                        validator.Extension      = validatorExtension;
                        validatorExtensionLoaded = true;
                    }
                }

                // set the message handlers
                validator.Extension.Message += new MessageEventHandler(this.messageHandler.Display);

                // disable ICE33 and ICE66 by default
                this.suppressICEs.Add("ICE33");
                this.suppressICEs.Add("ICE66");

                // set the ICEs
                string[] iceArray = new string[this.ices.Count];
                this.ices.CopyTo(iceArray, 0);
                validator.ICEs = iceArray;

                // set the suppressed ICEs
                string[] suppressICEArray = new string[this.suppressICEs.Count];
                this.suppressICEs.CopyTo(suppressICEArray, 0);
                validator.SuppressedICEs = suppressICEArray;

                // Load the pdb and assign the Output to the validator
                if (null != pdbPath)
                {
                    string pdbFullPath = Path.GetFullPath(pdbPath);
                    Pdb    pdb         = Pdb.Load(pdbFullPath, false, false);
                    this.validator.Output = pdb.Output;
                }

                foreach (string inputFile in this.inputFiles)
                {
                    // set the default cube file
                    Assembly assembly     = Assembly.GetExecutingAssembly();
                    string   appDirectory = Path.GetDirectoryName(assembly.Location);

                    if (this.addDefault)
                    {
                        switch (Path.GetExtension(inputFile).ToLower(CultureInfo.InvariantCulture))
                        {
                        case msm:
                            validator.AddCubeFile(Path.Combine(appDirectory, "mergemod.cub"));
                            break;

                        case msi:
                            validator.AddCubeFile(Path.Combine(appDirectory, "darice.cub"));
                            break;

                        default:
                            throw new WixException(WixErrors.UnexpectedFileExtension(inputFile, ".msi, .msm"));
                        }
                    }

                    // print friendly message saying what file is being validated
                    Console.WriteLine(Path.GetFileName(inputFile));

                    try
                    {
                        validator.Validate(Path.GetFullPath(inputFile));
                    }
                    catch (UnauthorizedAccessException)
                    {
                        this.messageHandler.Display(this, WixErrors.UnauthorizedAccess(Path.GetFullPath(inputFile)));
                    }
                    finally
                    {
                        if (this.tidy)
                        {
                            if (!validator.DeleteTempFiles())
                            {
                                Console.WriteLine(SmokeStrings.WAR_FailedToDeleteTempDir, validator.TempFilesLocation);
                            }
                        }
                        else
                        {
                            Console.WriteLine(SmokeStrings.INF_TempDirLocatedAt, validator.TempFilesLocation);
                        }
                    }
                }
            }
            catch (WixException we)
            {
                this.messageHandler.Display(this, we.Error);
            }
            catch (Exception e)
            {
                this.messageHandler.Display(this, WixErrors.UnexpectedException(e.Message, e.GetType().ToString(), e.StackTrace));
                if (e is NullReferenceException || e is SEHException)
                {
                    throw;
                }
            }

            return(this.messageHandler.LastErrorNumber);
        }
예제 #23
0
        /// <summary>
        /// 画面読み込み後のイベント処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            this.OkButton.FontSize     = 9;
            this.OkButton.Content      = "\n\n\n選択(F11)";
            this.CancelButton.FontSize = 9;
            this.CancelButton.Content  = "\n\n\n終了(F1)";

            // 初期フォーカスの設定を行う
            this.txtName.Focus();
            GridOutPut();
            // 画面サイズをタスクバーをのぞいた状態で表示させる
            this.Height = WinFormsScreen.PrimaryScreen.WorkingArea.Size.Height;

            // メイン画面と子画面が被ることなく表示できるかチェック
            if (WinFormsScreen.PrimaryScreen.WorkingArea.Size.Width < 1024 + 342)
            {
                // 画面の左端に表示させる
                this.Left = WinFormsScreen.PrimaryScreen.WorkingArea.Size.Width - this.Width;
            }

            // コンボボックスのSelectionChangedを設定する。
            this.OrderColumn.SelectionChanged += this.OrderColumn_SelectionChanged;

            #region 設定項目取得
            ucfg   = AppCommon.GetConfig(this);
            frmcfg = (ConfigSCH_M16HINGUN)ucfg.GetConfigValue(typeof(ConfigSCH_M16HINGUN));
            if (frmcfg == null)
            {
                frmcfg = new ConfigSCH_M16HINGUN();
                ucfg.SetConfigValue(frmcfg);
            }
            else
            {
                // 表示できるかチェック
                var WidthCHK = WinFormsScreen.PrimaryScreen.Bounds.Width - frmcfg.Left;
                if (WidthCHK > 10)
                {
                    this.Left = frmcfg.Left;
                }
                // 表示できるかチェック
                var HeightCHK = WinFormsScreen.PrimaryScreen.Bounds.Height - frmcfg.Top;
                if (HeightCHK > 10)
                {
                    this.Top = frmcfg.Top;
                }
                this.Height = frmcfg.Height;
                this.Width  = frmcfg.Width;
                this.OrderColumn.SelectedIndex = frmcfg.Combo;
            }
            #endregion

            AppCommon.SetutpComboboxList(this.OrderColumn, false);

            #region 表示順序

            if (SearchResult == null)
            {
                return;
            }

            DataView view = new DataView(SearchResult);

            switch (OrderColumn.SelectedIndex)
            {
            case 0:     // コード
            default:
                view.Sort = COLUM_ID;
                break;

            case 1:     // 名称
                view.Sort = COLUM_NAME;
                break;

            case 2:     // カナ
                view.Sort = COLUM_KANA;
                break;
            }

            SearchResult = view.ToTable();

            #endregion
        }
예제 #24
0
파일: light.cs 프로젝트: slamj1/Core-4
        private void Run(IMessaging messaging)
        {
#if false
            // Initialize the variable resolver from the command line.
            WixVariableResolver wixVariableResolver = new WixVariableResolver();
            foreach (var wixVar in this.commandLine.Variables)
            {
                wixVariableResolver.AddVariable(wixVar.Key, wixVar.Value);
            }

            // Initialize the linker from the command line.
            Linker linker = new Linker();
            linker.UnreferencedSymbolsFile = this.commandLine.UnreferencedSymbolsFile;
            linker.ShowPedanticMessages    = this.commandLine.ShowPedanticMessages;
            linker.WixVariableResolver     = wixVariableResolver;

            foreach (IExtensionData data in this.extensionData)
            {
                linker.AddExtensionData(data);
            }

            // Initialize the binder from the command line.
            WixToolset.Binder binder = new WixToolset.Binder();
            binder.CabCachePath     = this.commandLine.CabCachePath;
            binder.ContentsFile     = this.commandLine.ContentsFile;
            binder.BuiltOutputsFile = this.commandLine.BuiltOutputsFile;
            binder.OutputsFile      = this.commandLine.OutputsFile;
            binder.WixprojectFile   = this.commandLine.WixprojectFile;
            binder.BindPaths.AddRange(this.commandLine.BindPaths);
            binder.CabbingThreadCount = this.commandLine.CabbingThreadCount;
            if (this.commandLine.DefaultCompressionLevel.HasValue)
            {
                binder.DefaultCompressionLevel = this.commandLine.DefaultCompressionLevel.Value;
            }
            binder.Ices.AddRange(this.commandLine.Ices);
            binder.SuppressIces.AddRange(this.commandLine.SuppressIces);
            binder.SuppressAclReset    = this.commandLine.SuppressAclReset;
            binder.SuppressLayout      = this.commandLine.SuppressLayout;
            binder.SuppressValidation  = this.commandLine.SuppressValidation;
            binder.PdbFile             = this.commandLine.SuppressWixPdb ? null : this.commandLine.PdbFile;
            binder.TempFilesLocation   = AppCommon.GetTempLocation();
            binder.WixVariableResolver = wixVariableResolver;

            foreach (IBinderExtension extension in this.binderExtensions)
            {
                binder.AddExtension(extension);
            }

            foreach (IBinderFileManager fileManager in this.fileManagers)
            {
                binder.AddExtension(fileManager);
            }

            // Initialize the localizer.
            Localizer localizer = this.InitializeLocalization(linker.TableDefinitions);
            if (messaging.EncounteredError)
            {
                return;
            }

            wixVariableResolver.Localizer = localizer;
            linker.Localizer = localizer;
            binder.Localizer = localizer;

            // Loop through all the believed object files.
            List <Section> sections = new List <Section>();
            Output         output   = null;
            foreach (string inputFile in this.commandLine.Files)
            {
                string     inputFileFullPath = Path.GetFullPath(inputFile);
                FileFormat format            = FileStructure.GuessFileFormatFromExtension(Path.GetExtension(inputFileFullPath));
                bool       retry;
                do
                {
                    retry = false;

                    try
                    {
                        switch (format)
                        {
                        case FileFormat.Wixobj:
                            Intermediate intermediate = Intermediate.Load(inputFileFullPath, linker.TableDefinitions, this.commandLine.SuppressVersionCheck);
                            sections.AddRange(intermediate.Sections);
                            break;

                        case FileFormat.Wixlib:
                            Library library = Library.Load(inputFileFullPath, linker.TableDefinitions, this.commandLine.SuppressVersionCheck);
                            AddLibraryLocalizationsToLocalizer(library, this.commandLine.Cultures, localizer);
                            sections.AddRange(library.Sections);
                            break;

                        default:
                            output = Output.Load(inputFileFullPath, this.commandLine.SuppressVersionCheck);
                            break;
                        }
                    }
                    catch (WixUnexpectedFileFormatException e)
                    {
                        format = e.FileFormat;
                        retry  = (FileFormat.Wixobj == format || FileFormat.Wixlib == format || FileFormat.Wixout == format); // .wixobj, .wixout and .wixout are supported by light.
                        if (!retry)
                        {
                            messaging.OnMessage(e.Error);
                        }
                    }
                } while (retry);
            }

            // Stop processing if any errors were found loading object files.
            if (messaging.EncounteredError)
            {
                return;
            }

            // and now for the fun part
            if (null == output)
            {
                OutputType expectedOutputType = OutputType.Unknown;
                if (!String.IsNullOrEmpty(this.commandLine.OutputFile))
                {
                    expectedOutputType = Output.GetOutputType(Path.GetExtension(this.commandLine.OutputFile));
                }

                output = linker.Link(sections, expectedOutputType);

                // If an error occurred during linking, stop processing.
                if (null == output)
                {
                    return;
                }
            }
            else if (0 != sections.Count)
            {
                throw new InvalidOperationException(LightStrings.EXP_CannotLinkObjFilesWithOutpuFile);
            }

            bool tidy = true; // clean up after ourselves by default.
            try
            {
                // only output the xml if its a patch build or user specfied to only output wixout
                string outputFile      = this.commandLine.OutputFile;
                string outputExtension = Path.GetExtension(outputFile);
                if (this.commandLine.OutputXml || OutputType.Patch == output.Type)
                {
                    if (String.IsNullOrEmpty(outputExtension) || outputExtension.Equals(".wix", StringComparison.Ordinal))
                    {
                        outputExtension = (OutputType.Patch == output.Type) ? ".wixmsp" : ".wixout";
                        outputFile      = Path.ChangeExtension(outputFile, outputExtension);
                    }

                    output.Save(outputFile);
                }
                else // finish creating the MSI/MSM
                {
                    if (String.IsNullOrEmpty(outputExtension) || outputExtension.Equals(".wix", StringComparison.Ordinal))
                    {
                        outputExtension = Output.GetExtension(output.Type);
                        outputFile      = Path.ChangeExtension(outputFile, outputExtension);
                    }

                    binder.Bind(output, outputFile);
                }
            }
            catch (WixException we) // keep files around for debugging IDT issues.
            {
                if (we is WixInvalidIdtException)
                {
                    tidy = false;
                }

                throw;
            }
            catch (Exception) // keep files around for debugging unexpected exceptions.
            {
                tidy = false;
                throw;
            }
            finally
            {
                if (null != binder)
                {
                    binder.Cleanup(tidy);
                }
            }

            return;
#endif
        }
예제 #25
0
        /// <summary>
        /// 文件夹添加
        /// </summary>
        private void Add(HttpContext Context)
        {
            Hashtable FileTable  = new Hashtable();
            int       Id         = 0;
            int       UserId     = 0;
            string    Username   = "";
            int       FolderId   = 0;
            string    FolderPath = "";
            string    Name       = "";
            string    Remark     = "";
            int       Inherit    = 0;
            int       Share      = 0;
            string    Sql        = "";

            if (Base.Common.IsNumeric(Context.Request.Form["FolderId"]) == true)
            {
                FolderId = Context.Request.Form["FolderId"].TypeInt();
            }

            FolderPath = AppCommon.FolderIdPath(FolderId, ref Conn);

            Name = Base.Common.InputFilter(Context.Request.Form["Name"].TypeString());

            if (Base.Common.StringCheck(Name, @"^[^\\\/\:\*\?\""\<\>\|]{1,50}$") == false)
            {
                return;
            }

            Remark = Base.Common.InputFilter(Context.Request.Form["Remark"].TypeString());

            if (string.IsNullOrEmpty(Remark) == false)
            {
                if (Base.Common.StringCheck(Remark, @"^[\s\S]{1,100}$") == false)
                {
                    return;
                }
            }

            Inherit = Context.Request.Form["Inherit"].TypeString() == "true" ? 1 : 0;

            Share = Context.Request.Form["Share"].TypeString() == "true" ? 1 : 0;

            if (FolderId > 0)
            {
                if (AppCommon.PurviewCheck(FolderId, true, "manager", ref Conn) == false)
                {
                    Context.Response.Write("no-permission");
                    return;
                }

                if (Inherit == 1)
                {
                    Base.Data.SqlDataToTable("Select DBS_Id, DBS_UserId, DBS_Username, DBS_Folder, DBS_Share From DBS_File Where DBS_Folder = 1 And DBS_Id = " + FolderId, ref Conn, ref FileTable);

                    if (FileTable["Exist"].TypeBool() == false)
                    {
                        return;
                    }
                    else
                    {
                        UserId   = FileTable["DBS_UserId"].TypeInt();
                        Username = FileTable["DBS_Username"].TypeString();
                        Share    = FileTable["DBS_Share"].TypeInt();
                    }

                    FileTable.Clear();
                }
            }

            if (FolderExist(0, FolderId, Name, Context) == true)
            {
                Context.Response.Write("existed");
                return;
            }

            Sql  = "Insert Into DBS_File(DBS_UserId, DBS_Username, DBS_Version, DBS_VersionId, DBS_Folder, DBS_FolderId, DBS_FolderPath, DBS_CodeId, DBS_Hash, DBS_Name, DBS_Extension, DBS_Size, DBS_Type, DBS_Remark, DBS_Share, DBS_Lock, DBS_Sync, DBS_Recycle, DBS_CreateUsername, DBS_CreateTime, DBS_UpdateUsername, DBS_UpdateTime, DBS_RemoveUsername, DBS_RemoveTime) ";
            Sql += "Values(" + (UserId == 0 ? Context.Session["UserId"].TypeString() : UserId.ToString()) + ", '" + (UserId == 0 ? Context.Session["Username"].TypeString() : Username) + "', 0, 0, 1, " + FolderId + ", '" + (FolderId == 0 ? "/0/" : FolderPath) + "', 'null', 'null', '" + Name + "', 'null', 0, 'folder', '" + Remark + "', " + Share + ", 0, " + Inherit + ", 0, '" + Context.Session["Username"].TypeString() + "', '" + DateTime.Now.ToString() + "', '" + Context.Session["Username"].TypeString() + "', '" + DateTime.Now.ToString() + "', 'null', '1970/1/1 00:00:00')";

            Id = Base.Data.SqlInsert(Sql, ref Conn);

            if (Id == 0)
            {
                return;
            }

            if (FolderPath.Length == 0)
            {
                Directory.CreateDirectory(Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), Id.ToString()));
            }
            else
            {
                Directory.CreateDirectory(Base.Common.PathCombine(Context.Server.MapPath("/storage/file/"), FolderPath.Substring(1), Id.ToString()));
            }

            if (FolderId > 0 && Inherit == 1)
            {
                PurviewInherit(Id, FolderId);
            }

            AppCommon.Log(Id, "folder-add", ref Conn);

            if (Share == 1)
            {
                Context.Response.Write(Id.ToString());
                return;
            }

            Context.Response.Write("complete");
        }
예제 #26
0
        /// <summary>
        /// Main running method for the application.
        /// </summary>
        /// <param name="args">Commandline arguments to the application.</param>
        /// <returns>Returns the application error code.</returns>
        private int Run(string[] args)
        {
            try
            {
                // parse the command line
                this.ParseCommandLine(args);

                // exit if there was an error parsing the command line (otherwise the logo appears after error messages)
                if (Messaging.Instance.EncounteredError)
                {
                    return(Messaging.Instance.LastErrorNumber);
                }

                if (0 == this.inputFiles.Count)
                {
                    this.showHelp = true;
                }

                if (this.showLogo)
                {
                    AppCommon.DisplayToolHeader();
                }

                if (this.showHelp)
                {
                    Console.WriteLine(SmokeStrings.HelpMessage);
                    AppCommon.DisplayToolFooter();
                    return(Messaging.Instance.LastErrorNumber);
                }

                foreach (string parameter in this.invalidArgs)
                {
                    Messaging.Instance.OnMessage(WixWarnings.UnsupportedCommandLineArgument(parameter));
                }
                this.invalidArgs = null;

                string tempFilesLocation = AppCommon.GetTempLocation();
                validator.TempFilesLocation = tempFilesLocation;

                // TODO: rename ValidatorExtensions to "ValidatorFilterExtension" or something like that. Actually,
                //       revisit all of this as we try to build a more generic validation system around ICEs.
                //
                // load any extensions
                //bool validatorExtensionLoaded = false;
                //foreach (string extension in this.extensionList)
                //{
                //    WixExtension wixExtension = WixExtension.Load(extension);

                //    ValidatorExtension validatorExtension = wixExtension.ValidatorExtension;
                //    if (null != validatorExtension)
                //    {
                //        if (validatorExtensionLoaded)
                //        {
                //            throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, SmokeStrings.EXP_CannotLoadLinkerExtension, validatorExtension.GetType().ToString(), validator.Extension.ToString()), "ext");
                //        }

                //        validator.Extension = validatorExtension;
                //        validatorExtensionLoaded = true;
                //    }
                //}

                // disable ICE33 and ICE66 by default
                this.suppressICEs.Add("ICE33");
                this.suppressICEs.Add("ICE66");

                // set the ICEs
                string[] iceArray = new string[this.ices.Count];
                this.ices.CopyTo(iceArray, 0);
                validator.ICEs = iceArray;

                // set the suppressed ICEs
                string[] suppressICEArray = new string[this.suppressICEs.Count];
                this.suppressICEs.CopyTo(suppressICEArray, 0);
                validator.SuppressedICEs = suppressICEArray;

                // Load the pdb and assign the Output to the validator
                if (null != pdbPath)
                {
                    string pdbFullPath = Path.GetFullPath(pdbPath);
                    Pdb    pdb         = Pdb.Load(pdbFullPath, false);
                    this.validator.Output = pdb.Output;
                }

                foreach (string inputFile in this.inputFiles)
                {
                    // set the default cube file
                    Assembly assembly     = Assembly.GetExecutingAssembly();
                    string   appDirectory = Path.GetDirectoryName(assembly.Location);

                    if (this.addDefault)
                    {
                        switch (Path.GetExtension(inputFile).ToLower(CultureInfo.InvariantCulture))
                        {
                        case msm:
                            validator.AddCubeFile(Path.Combine(appDirectory, "mergemod.cub"));
                            break;

                        case msi:
                            validator.AddCubeFile(Path.Combine(appDirectory, "darice.cub"));
                            break;

                        default:
                            throw new WixException(WixErrors.UnexpectedFileExtension(inputFile, ".msi, .msm"));
                        }
                    }

                    // print friendly message saying what file is being validated
                    Console.WriteLine(Path.GetFileName(inputFile));
                    Stopwatch stopwatch = Stopwatch.StartNew();

                    try
                    {
                        validator.Validate(Path.GetFullPath(inputFile));
                    }
                    catch (UnauthorizedAccessException)
                    {
                        Messaging.Instance.OnMessage(WixErrors.UnauthorizedAccess(Path.GetFullPath(inputFile)));
                    }
                    finally
                    {
                        stopwatch.Stop();
                        Messaging.Instance.OnMessage(WixVerboses.ValidatedDatabase(stopwatch.ElapsedMilliseconds));

                        if (this.tidy)
                        {
                            if (!AppCommon.DeleteDirectory(tempFilesLocation, Messaging.Instance))
                            {
                                Console.Error.WriteLine(SmokeStrings.WAR_FailedToDeleteTempDir, tempFilesLocation);
                            }
                        }
                        else
                        {
                            Console.WriteLine(SmokeStrings.INF_TempDirLocatedAt, tempFilesLocation);
                        }
                    }
                }
            }
            catch (WixException we)
            {
                Messaging.Instance.OnMessage(we.Error);
            }
            catch (Exception e)
            {
                Messaging.Instance.OnMessage(WixErrors.UnexpectedException(e.Message, e.GetType().ToString(), e.StackTrace));
                if (e is NullReferenceException || e is SEHException)
                {
                    throw;
                }
            }

            return(Messaging.Instance.LastErrorNumber);
        }
예제 #27
0
        /// <summary>
        /// Main running method for the application.
        /// </summary>
        private void Run()
        {
            WixVariableResolver wixVariableResolver = new WixVariableResolver();

            // Initialize the binder from the command line.
            WixToolset.Binder binder = new WixToolset.Binder();
            binder.CabCachePath = this.commandLine.CabCachePath;
            //binder.DeltaBinaryPatch = this.commandLine.Delta;
            //binder.ContentsFile = this.commandLine.ContentsFile;
            //binder.BuiltOutputsFile = this.commandLine.BuiltOutputsFile;
            //binder.OutputsFile = this.commandLine.OutputsFile;
            //binder.WixprojectFile = this.commandLine.WixprojectFile;
            //binder.BindPaths.AddRange(this.commandLine.BindPaths);
            binder.TargetBindPaths.AddRange(this.commandLine.TargetBindPaths);
            binder.UpdatedBindPaths.AddRange(this.commandLine.UpdatedBindPaths);
            //binder.CabbingThreadCount = this.commandLine.CabbingThreadCount;
            //binder.DefaultCompressionLevel = this.commandLine.DefaultCompressionLevel;
            //binder.ExactAssemblyVersions = this.commandLine.ExactAssemblyVersions;
            binder.SuppressAclReset = this.commandLine.SuppressAclReset;
            //binder.SuppressLayout = this.commandLine.SuppressLayout;
            binder.SuppressValidation  = true;
            binder.PdbFile             = this.commandLine.SuppressWixPdb ? null : this.commandLine.PdbFile;
            binder.TempFilesLocation   = AppCommon.GetTempLocation();
            binder.WixVariableResolver = wixVariableResolver;

            foreach (IBinderExtension extension in this.binderExtensions)
            {
                binder.AddExtension(extension);
            }

            foreach (IBinderFileManager fileManager in this.fileManagers)
            {
                binder.AddExtension(fileManager);
            }

            // Create and configure the patch
            Patch patch = new Patch();

            patch.Load(this.commandLine.InputFile);
            patch.AttachTransforms(this.commandLine.PatchTransforms);

            bool tidy = true; // clean up after ourselves by default.

            try
            {
                // Bind the patch to an msp.
                binder.Bind(patch.PatchOutput, this.commandLine.OutputFile);
            }
            catch (WixException we)
            {
                if (we is WixInvalidIdtException)
                {
                    tidy = false;
                }

                throw;
            }
            catch (Exception)
            {
                tidy = false;
                throw;
            }
            finally
            {
                if (null != binder)
                {
                    binder.Cleanup(tidy);
                }
            }

            return;
        }
예제 #28
0
        /// <summary>
        /// F8 リボン 印刷
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF8Key(object sender, KeyEventArgs e)
        {
            PrinterDriver ret = AppCommon.GetPrinter(frmcfg.PrinterName);

            if (ret.Result == false)
            {
                this.ErrorMessage = "プリンタドライバーがインストールされていません!";
                return;
            }
            frmcfg.PrinterName = ret.PrinterName;


            //作成年月
            string s作成年月;
            int    集計年月;

            if (string.IsNullOrEmpty(作成年) || string.IsNullOrEmpty(作成月))
            {
                this.ErrorMessage = "作成年月は入力必須項目です。";
                MessageBox.Show("作成年月は入力必須項目です。");
                return;
            }
            else
            {
                s作成年月 = 作成年 + 作成月;
                集計年月  = Convert.ToInt32(s作成年月);
            }

            if (string.IsNullOrEmpty(作成締日) && 全締日集計 == false)
            {
                this.ErrorMessage = "作成締日の入力形式が不正です。";
                MessageBox.Show("作成締日の入力形式が不正です。");
                SetFocusToTopControl();
                return;
            }

            if (!base.CheckAllValidation())
            {
                MessageBox.Show("入力内容に誤りがあります。");
                SetFocusToTopControl();
                return;
            }

            //コンボボックスのIndexを取得
            int Cmb_集計区分, Cmb_表示区分, Cmd_表示順序;

            Cmb_集計区分 = 集計区分_Cmb.SelectedIndex;
            Cmb_表示区分 = 表示区分_Cmb.SelectedIndex;
            Cmd_表示順序 = 表示順序_Cmb.SelectedIndex;

            //支払先リスト作成
            int?[] i支払先List = new int?[0];
            if (!string.IsNullOrEmpty(支払先ピックアップ))
            {
                string[] 支払先List = 支払先ピックアップ.Split(',');
                i支払先List = new int?[支払先List.Length];

                for (int i = 0; i < 支払先List.Length; i++)
                {
                    string str = 支払先List[i];
                    int    code;
                    if (!int.TryParse(str, out code))
                    {
                        this.ErrorMessage = "支払先指定の形式が不正です。";
                        return;
                    }
                    i支払先List[i] = code;
                }
            }

            if (Cmb_集計区分 == 0)
            {
                //締日データ
                base.SendRequest(new CommunicationObject(MessageType.RequestDataWithBusy, SEARCH_SHR08010, new object[] { 支払先From, 支払先To, i支払先List, 作成締日, 全締日集計, 集計年月, Cmb_集計区分, Cmb_表示区分, 作成年, 作成月, Cmd_表示順序 }));
            }
            else
            {
                //月次データ
                base.SendRequest(new CommunicationObject(MessageType.RequestDataWithBusy, SEARCH_SHR08010g, new object[] { 支払先From, 支払先To, i支払先List, 作成締日, 全締日集計, 集計年月, Cmb_集計区分, Cmb_表示区分, 作成年, 作成月, Cmd_表示順序 }));
            }
        }
예제 #29
0
        /// <summary>
        /// Extracts files from an MSI database and rewrites the paths embedded in the source .wixpdb to the output .wixpdb.
        /// </summary>
        private void MeltProduct()
        {
            // print friendly message saying what file is being decompiled
            Console.WriteLine("{0} / {1}", Path.GetFileName(this.inputFile), Path.GetFileName(this.inputPdbFile));

            Pdb inputPdb = Pdb.Load(this.inputPdbFile, true, true);

            // extract files from the .msi (unless suppressed) and get the path map of File ids to target paths
            string outputDirectory  = this.exportBasePath ?? Environment.GetEnvironmentVariable("WIX_TEMP");
            string exportBinaryPath = null;
            string exportIconPath   = null;

            if (this.exportToSubDirectoriesFormat)
            {
                exportBinaryPath = Path.Combine(outputDirectory, "Binary");
                exportIconPath   = Path.Combine(outputDirectory, "Icon");
                outputDirectory  = Path.Combine(outputDirectory, "File");
            }

            Table wixFileTable = inputPdb.Output.Tables["WixFile"];

            IDictionary <string, string> paths = null;

            using (InstallPackage package = new InstallPackage(this.inputFile, DatabaseOpenMode.ReadOnly, null, outputDirectory))
            {
                // ignore failures as this is a new validation in v3.x
                ValidateMsiMatchesPdb(package, inputPdb);

                if (!this.suppressExtraction)
                {
                    package.ExtractFiles();

                    if (this.exportToSubDirectoriesFormat)
                    {
                        Melt.MeltBinaryTable(inputPdb, package, exportBinaryPath, "Binary");
                        Melt.MeltBinaryTable(inputPdb, package, exportIconPath, "Icon");
                    }
                }

                paths = package.Files.SourcePaths;
            }

            if (null != wixFileTable)
            {
                foreach (Row row in wixFileTable.Rows)
                {
                    WixFileRow fileRow = row as WixFileRow;
                    if (null != fileRow)
                    {
                        string newPath;
                        if (paths.TryGetValue(fileRow.File, out newPath))
                        {
                            fileRow.Source = Path.Combine(outputDirectory, newPath);
                        }
                    }
                }
            }

            string tempPath = Path.Combine(Environment.GetEnvironmentVariable("WIX_TEMP") ?? Path.GetTempPath(), Path.GetRandomFileName());

            try
            {
                inputPdb.Save(this.outputFile, null, null, tempPath);
            }
            finally
            {
                if (this.tidy)
                {
                    if (!AppCommon.DeleteDirectory(tempPath, this.messageHandler))
                    {
                        Console.WriteLine(MeltStrings.WAR_FailedToDeleteTempDir, tempPath);
                    }
                }
                else
                {
                    Console.WriteLine(MeltStrings.INF_TempDirLocatedAt, tempPath);
                }
            }
        }
예제 #30
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            TBL_MP_CRM_SalesQuotation objQuote      = null;
            ServiceSalesQuotation     _serviceQuote = null;

            try
            {
                errorProvider1.Clear();
                if (this.ValidateChildren())
                {
                    _serviceQuote = new ServiceSalesQuotation();;
                    if (this.SalesQuotationID == 0)
                    {
                        objQuote = new TBL_MP_CRM_SalesQuotation();
                        objQuote.PK_Quotation_ID = 0;
                        objQuote.FK_YearID       = Program.CURR_USER.FinYearID;
                        objQuote.FK_BranchID     = Program.CURR_USER.BranchID;
                        objQuote.FK_CompanyID    = Program.CURR_USER.CompanyID;
                        objQuote.Quotation_No    = txtQuotationNumber.Text.ToUpper().Trim();
                        //objQuote.Quotation_No = _serviceQuote.GenerateNewSalesQuotationNumber(objQuote.FK_YearID,objQuote.FK_BranchID,objQuote.FK_CompanyID);
                    }
                    else
                    {
                        objQuote = _serviceQuote.GetSalesQuotationMasterDBInfo(this.SalesQuotationID);
                    }

                    // GATHER DATA
                    objQuote.Quotation_Date = dtQuotationDate.Value;
                    objQuote.FK_Userlist_Quotation_Status_ID = ((SelectListItem)cboQuotationStatus.SelectedItem).ID;
                    objQuote.Quotation_ValidDays             = int.Parse(txtQuotationValidDays.Text);
                    objQuote.FK_Userlist_Priority_ID         = ((SelectListItem)cboQuotationPriority.SelectedItem).ID;
                    objQuote.FK_RepresentativeID             = ((SelectListItem)cboSalesRepresentative.SelectedItem).ID;
                    objQuote.FK_BOQRepresentativeID          = ((SelectListItem)cboBOQRepresentative.SelectedItem).ID;
                    objQuote.FK_Sales_Enquiry_ID             = this.SelectedSalesEnquiryID;
                    objQuote.FK_Customer_ID               = ((SelectListItem)cboClient.SelectedItem).ID;
                    objQuote.Project_Name                 = txtProjectName.Text.Trim();
                    objQuote.FK_Project_City_ID           = ((SelectListItem)cboProjectLocation.SelectedItem).ID;
                    objQuote.FK_Userlist_ProjectSector_ID = ((SelectListItem)cboProjectSector.SelectedItem).ID;

                    objQuote.Remarks     = txtRemarks.Text;
                    objQuote.ReasonClose = txtReasonClosedLost.Text;

                    if (this.SalesQuotationID == 0)
                    {
                        this.SalesQuotationID = _serviceQuote.AddNewQuotation(objQuote);
                        _serviceQuote.GenerateDefaultsFromSalesEnquiryIntoSalesQuotation(this.SelectedSalesEnquiryID, SalesQuotationID);
                    }
                    else
                    {
                        objQuote.LastModifiedBy   = Program.CURR_USER.EmployeeID;
                        objQuote.LastModifiedDate = AppCommon.GetServerDateTime();
                        _serviceQuote.UpdateSalesQuotation(objQuote);
                    }

                    this.DialogResult = DialogResult.OK;
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "frmSalesQuotation::btnSave_Click", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }