Пример #1
0
 public static void SetTitle(Form frm, FormStatus status)
 {
     bool IsDebug = FrameworkParams.isSupportDeveloper;
     if (IsDebug == false)
     {
         switch (status)
         {
             case FormStatus.NO:
                 frm.Text += " NO ";//+ frm.Text;
                 return;
             case FormStatus.NC:
                 frm.Text += " NC ";//+ frm.Text;
                 return;
             case FormStatus.OK_DEV:
                 frm.Text += " OK_DEV ";//+ frm.Text;
                 return;
             case FormStatus.OK_TEST:
                 frm.Text += " OK_TEST ";//+ frm.Text;
                 return;
             case FormStatus.FIX:
                 frm.Text += " FIX ";//+ frm.Text;
                 return;
             case FormStatus.FIXED:
                 frm.Text += " FIXED ";//+ frm.Text;
                 return;
         }
     }
 }
Пример #2
0
 private void StageSubmodule()
 {
     var processStart = new FormStatus.ProcessStart(delegate(FormStatus form)
         {
             form.AddMessageLine(string.Format(_stageFilename.Text,
                 _filename));
             string output = Module.RunGitCmd("add -- \"" + _filename + "\"");
             form.AddMessageLine(output);
             form.Done(string.IsNullOrEmpty(output));
         });
     using (var process = new FormStatus(processStart, null) { Text = string.Format(_stageFilename.Text, _filename) })
         process.ShowDialogOnError(this);
 }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region
        try
        {

            ResultMsgLabel.Text = "";
            ErrorMsgLabel.Text = "";

            if (!IsPostBack)
            {
                fmStatus = FormStatus.fmBrowse;
                btn_Exec.Attributes.Add("onclick", "Page_ClientValidate('1');if(Page_IsValid==false){return false;}Page_ClientValidate('2');if(Page_IsValid==false){return false;}CheckBatchPatternCopyIsTheSameKey();if(Page_IsValid==false){return false;}");


                #region 設定TabIndex

                SLP_RootNo1.TextBox_Code.TabIndex = 1;
                SLP_PMA1.TextBox_Code.TabIndex = 2;
                SLP_Pattern1.TextBox_Code.TabIndex = 3;

                SLP_RootNo2.TextBox_Code.TabIndex = 4;
                SLP_PMA2.TextBox_Code.TabIndex = 5;
                SLP_Pattern2.TextBox_Code.TabIndex = 6;

                btn_Exec.TabIndex = 7;
                btn_Back.TabIndex = 8;
 
                #endregion

            
            }

            RegTextAttr();

            RegClientScript();

            ToolBarInit();
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region
        try
        {

            ResultMsgLabel.Text = "";
            ErrorMsgLabel.Text = "";

            if (!IsPostBack)
            {

                fmStatus = FormStatus.fmBrowse;
                btn_Exec.Attributes.Add("onclick", string.Format("{1}SetFormStatus('{0}');", FormStatus.fmProcess.ToString(), "CheckBatchItemCopyIsTheSameKey();if(Page_IsValid==false){return false;}"));

                ToolBarInit();

                AuthorityControls(this);

                #region 設定TabIndex

                SLP_SKU1.TextBox_Code.TabIndex = 1;
                SLP_SKU2.TextBox_Code.TabIndex = 2;
                btn_Exec.TabIndex = 3;
                btn_Back.TabIndex = 4;
                #endregion


            }


        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
Пример #5
0
 public void StartStorageSCPEmulator()
 {
     // We know that the emulator session is already selected. Now we need
     // to make sure that the Storage SCP Emulator item is selected.
     foreach (TreeNode node in this.SessionBrowser.SelectedNode.Nodes)
     {
         if (node.Text == "Storage SCP Emulator")
             this.SessionBrowser.SelectedNode = node;
     }
     if (this.selected_session is Dvtk.Sessions.EmulatorSession)
     {
         this._process_status = FormStatus.storage_scp_running;
         Dvtk.Sessions.EmulatorSession emulatorSession =
             this.selected_session as Dvtk.Sessions.EmulatorSession;
         //
         // Set proper emulator type before starting.
         // This type is reflected in header of results.
         //
         emulatorSession.ScpEmulatorType = DvtkData.Results.ScpEmulatorType.Storage;
         emulatorSession.ScuEmulatorType = DvtkData.Results.ScuEmulatorType.Unknown;
         //this.project.AddRunningEmulatorSession(emulatorSession.SessionFileName);
         this.UpdateUIProcessRunning();
         string fileName = string.Empty;
     //                    emulatorSession.SessionId.ToString ("000") + "_st_scp_em_res.xml";
         /*
             string.Format(
             "{0:000}{1}",
             emulatorSession.SessionId,
             "_st_scp_em_res.xml");
             */
         this.selected_session.StartResultsGatheringWithExpandedFileNaming(fileName);
         //
         // Update the UI to reflect that an emulator is executing
         //
         this.UpdateUIProcessRunning ();
         System.AsyncCallback cb = new AsyncCallback(this.OnEmulatorScpDone);
         System.IAsyncResult ar = emulatorSession.BeginEmulateSCP(cb);
     }
 }
        private void ConvertMedia_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (_Finito)
                return;

            SetPause?.Invoke(true);

            if (MessageBox.Show("Sicuro di voler interrompere il processo?", "Interrompere?", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
            {
                Stop?.Invoke();
                _Status = FormStatus.Closed;
            }
            else
            {
                SetPause?.Invoke(false);
                e.Cancel = true;
            }
        }
Пример #7
0
        /// <summary>
        /// This is the timer event that controls what our spash screen does.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SplashTimeUp(object sender, EventArgs e)
        {
            if (formStatus == FormStatus.Opening)
            {
                //if the splash is opening, the opacity will increase in increments of 5 until it is fully
                //shown.  Once it is fully opacic, it sets the status flag to open.
                if (base.MainForm.Opacity < 1)
                    base.MainForm.Opacity += .05;
                else
                    formStatus = FormStatus.Open;
            }
            else if (formStatus == FormStatus.Closing)
            {
                //if the splash is closing, the opacity will decrease in increments of 5 until it is fully
                //hidden.  Once it is fully transparent, it sets the status flag to closed.
                if (base.MainForm.Opacity > .10)
                {
                    base.MainForm.Opacity -= .05;
                    splashTimer.Interval = fadeInterval;
                }
                else
                {
                    formStatus = FormStatus.Closed;
                }
            }
            else if (formStatus == FormStatus.Open)
            {
                //Once the splash is open and fully shown, the timer interval is set to the splash delay setting,
                //which is defaulted to 2 seconds, and then sets the status flag depending on if the user
                //wants to just close the splash or fade it out.
                splashTimer.Interval = showSplashInterval;

                if (doFadeClose)
                    formStatus = FormStatus.Closing;
                else
                    formStatus = FormStatus.Closed;
            }
            else if(formStatus == FormStatus.Closed)
            {
                //This is called if the splash is ready to be closed.  In order to do this
                //we first dispose of the timer (we dont need any leaks do we?) and then
                //call the base.MainForm.Close function which will triger the MainFormClosed event
                //that we overrode so we can set the Application Context's main form as the
                //main form the user passed into the constructor.
                splashTimer.Enabled = false;
                splashTimer.Dispose();
                base.MainForm.Close();
            }
        }
 private void btnOK_Click(object sender, EventArgs e)
 {
     SelectedOrderLine = dgvOrderReleases.CurrentRow.DataBoundItem as OrderLine;
     FormStatus        = WTFClassLibrary.FormStatus.Succeeded;
     this.Dispose();
 }
Пример #9
0
 /// <summary>
 /// 預設UI作用控制
 /// </summary>
 private void PageControlStatus(FormStatus NowFormStatus)
 {
     switch (NowFormStatus)
     {
         case FormStatus.AllQuery:
             //通路
             TabContainer1.Enabled = true;
             DISNOTxt.Enabled = false;
             SettingChanControl(true);
             //SettingPOSSaleControl(POSSaleCheckBox.Checked);
             //SettingAllSaleControl(AllSaleCheckBox.Checked);
             //SettingPrePeriodControl(PrePeriodCheckBox.Checked);
             //SettingPOSAddControl(POSAddCheckBox.Checked);
             //SettingGoodsReturnControl(GoodsReturnCheckBox.Checked);
             //SettingQTYLessThanPreSaleControl(QTYLessThanPreSaleCheckBox.Checked);
             //SettingOrderImportTypeControl(OrderImportCheckBox.Checked);
             SettingMemoControl(true);
             ConfirmBtn.Enabled = true;
             ComputBtn.Enabled = true;
             //已確認資料,不可再異動
             if (Request.QueryString["APPROVE_DATE"] != null && Request.QueryString["APPROVE_DATE"].ToString().Trim() != "")
             {
                 ConfirmBtn.Enabled = false;
                 ComputBtn.Enabled = false;
             }
             BackBtn.Enabled = true;
             TabContainer2.Visible = false;
             break;
         case FormStatus.DetailView:
             TabContainer1.Enabled = false;
             //SettingChanControl(false);
             //SettingPOSSaleControl(false);
             //SettingAllSaleControl(false);
             //SettingPrePeriodControl(false);
             //SettingPOSAddControl(false);
             //SettingGoodsReturnControl(false);
             //SettingQTYLessThanPreSaleControl(false);
             //SettingOrderImportTypeControl(false);
             SettingMemoControl(false);
             TabContainer2.Visible = true;
             DetailBtnPanel.Enabled = true;
             break;
         case FormStatus.DetailAdd:
             TabContainer1.Enabled = false;
             //SettingChanControl(false);
             //SettingPOSSaleControl(false);
             //SettingAllSaleControl(false);
             //SettingPrePeriodControl(false);
             //SettingPOSAddControl(false);
             //SettingGoodsReturnControl(false);
             //SettingQTYLessThanPreSaleControl(false);
             //SettingOrderImportTypeControl(false);
             SettingMemoControl(false);
             TabContainer2.Visible = true;
             DetailBtnPanel.Enabled = false;
             break;
         case FormStatus.DetailEdit:
             TabContainer1.Enabled = false;
             //SettingChanControl(false);
             //SettingPOSSaleControl(false);
             //SettingAllSaleControl(false);
             //SettingPrePeriodControl(false);
             //SettingPOSAddControl(false);
             //SettingGoodsReturnControl(false);
             //SettingQTYLessThanPreSaleControl(false);
             //SettingOrderImportTypeControl(false);
             SettingMemoControl(false);
             TabContainer2.Visible = true;
             DetailBtnPanel.Enabled = false;
             break;
     }
 }
Пример #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region
        ErrorMsgLabel.Text = "";
        ResultMsgLabel.Text = "";

        if (!IsPostBack)
        {

            if (Request.QueryString["PageTimeStamp"] != null)
                PageTimeStamp.Value = Request.QueryString["PageTimeStamp"];
            else
                PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}",
                 DateTime.Now.Year.ToString(),
                 DateTime.Now.Month.ToString().PadLeft(2, '0'),
                 DateTime.Now.Day.ToString().PadLeft(2, '0'),
                 DateTime.Now.Hour.ToString().PadLeft(2, '0'),
                 DateTime.Now.Minute.ToString().PadLeft(2, '0'),
                 DateTime.Now.Second.ToString().PadLeft(2, '0')
                 );

            Session[string.Format("{0}_{1}", strPreFixed, PageTimeStamp.Value)] = null;

            ToolBarInit();

            AuthorityControls(this);

            iCurrentGvPageSize = (TextBoxPagesize.Text == "") ? 10 : (int.Parse(TextBoxPagesize.Text) <= 0) ? 10 : int.Parse(TextBoxPagesize.Text);
            iCurrentGvPageIndex = 0;

            string strJs_Confirm = "ClearAllMsg();CheckIsCheckedBeforeProcessing('CONFIRM');if(Page_IsValid==false){return false;}SetProcessingDisNosSatus('CONFIRM','');SetProcessingVisibleForFirstRecord('CONFIRM');ProcessingBridgeAtClient('CONFIRM');return false;";
            string strJs_Remove = "ClearAllMsg();CheckIsCheckedBeforeProcessing('REMOVE');if(Page_IsValid==false){return false;}SetProcessingDisNosSatus('REMOVE','');SetProcessingVisibleForFirstRecord('REMOVE');ProcessingBridgeAtClient('REMOVE');return false;";

            btn_ConfirmMulti.Attributes.Add("onclick", strJs_Confirm);
            btn_RemoveMulti.Attributes.Add("onclick", strJs_Remove);
            btn_ConfirmMulti.Visible = false;
            btn_RemoveMulti.Visible = false;

            hiddenUserID.Value = Session["UID"].ToString();

            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
            {
                hiddenNextDay.Value = DateTime.Now.AddDays(2).ToString("yyyyMMdd");//門市進貨日不可為星期日
            }
            else
            {
                hiddenNextDay.Value = DateTime.Now.AddDays(1).ToString("yyyyMMdd");
            }

            if (Request.QueryString["Requery"] != null)
            {
                if (Request.QueryString["Requery"].ToString() == "true")
                {
                    //SLP_StoreChain1.Text = Request.QueryString["ChanNo"];
                    QueryData();

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "CHECKBOXENABLED", string.Format("LockOrUnLockCheckBoxInGridview(true);SetGridviewCheckboxEnabled('{0}','{1}');", strEnabledConfirm, strEnabledRemove), true);
                    strEnabledConfirm = "";
                    strEnabledRemove = "";
                }
            }

            fmStatus = FormStatus.fmBrowse;

        }
        #endregion
    }
Пример #11
0
 protected void pbClose_Click(object sender, EventArgs e)
 {
     if (FormEffectable)
     {
         this.MinimumSize = new System.Drawing.Size(1, 1);
         this.frmstatus = FormStatus.Closing;
         pct = 1;
         this.timerAct.Start();
     }
     else
         this.Close();
 }
Пример #12
0
 private void dgvJobs_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     SelectedItemHistoryJob = dgvJobs.CurrentRow.DataBoundItem as ItemHistoryJob;
     FormStatus             = WTFClassLibrary.FormStatus.Succeeded;
     this.Dispose();
 }
Пример #13
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     SelectedItemHistoryJob = dgvJobs.CurrentRow.DataBoundItem as ItemHistoryJob;
     FormStatus             = WTFClassLibrary.FormStatus.Succeeded;
     this.Dispose();
 }
Пример #14
0
        /// <summary>
        /// 外部窗体初始化数据
        /// </summary>
        /// <param name="p_OpenSourceID">打开窗体源实体ID</param>
        /// <param name="p_TargetID">打开窗体目标实体ID</param>
        public override void OutIniDataStrong(ArrayList p_SourceObject, string p_OpenSourceID, string p_TargetID, FormStatus p_MFormStatus) //右键菜单打开代码
        {
            try                                                                                                                             //赋值,父窗体,防止非查询结果集窗体
            {
                if (p_SourceObject != null)
                {
                    for (int i = 0; i < p_SourceObject.Count; i++)
                    {
                        switch (SysConvert.ToString(((ArrayList)p_SourceObject[i])[i]))
                        {
                        case FUISourceObject.SourceForm:    //数据源Form
                            HTParentForm = (frmAPBaseUIWHForm)((ArrayList)p_SourceObject[i])[1];
                            if (HTParentForm != null)
                            {
                                if (HTParentForm.HTDataList != null && HTParentForm.HTDataList.GridControl != null && HTParentForm.HTDataList.GridControl.DataSource != null)
                                {
                                    _HTDataQueryResult = HTParentForm.HTDataList;
                                }
                                else
                                {
                                    _HTDataQueryResult = null;
                                }
                            }
                            else
                            {
                                _HTDataQueryResult = null;
                            }
                            break;

                        case FUISourceObject.SourceGridView:    //数据源Grid
                            _HTDataQueryResult = (GridView)((ArrayList)p_SourceObject[i])[1];
                            break;
                        }
                    }
                }
            }
            catch
            {
            }


            if (p_OpenSourceID != string.Empty && p_OpenSourceID != HTDataID.ToString())
            {
                HTDataID = SysConvert.ToInt32(p_OpenSourceID);
                //EntitySet();

                SetPosStatus(HTDataID);
            }
            HTFormStatus = p_MFormStatus;
            switch (p_MFormStatus)
            {
            case FormStatus.新增:
                btnInsert_Click(null, null);
                break;

            case FormStatus.修改:
                btnUpdate_Click(null, null);
                break;

            default:
                SetFormStatus(p_MFormStatus);
                break;
            }
        }
Пример #15
0
 public AddStudentInfoForm(FormStatus _fs, string _StuNo) : this()
 {
     this.FS    = _fs;
     this.StuNo = _StuNo;
 }
Пример #16
0
 /// <summary>
 /// 外部窗体初始化数据
 /// </summary>
 /// <param name="p_OpenSourceID">打开窗体源实体ID</param>
 /// <param name="p_TargetID">打开窗体目标实体ID</param>
 public override void OutIniDataStrong(ArrayList p_SourceObject, string p_OpenSourceID, string p_TargetID, FormStatus p_MFormStatus) //右键菜单打开代码
 {
     try                                                                                                                             //赋值,父窗体,防止非查询结果集窗体
     {
         if (p_SourceObject != null)
         {
             for (int i = 0; i < p_SourceObject.Count; i++)
             {
                 switch (SysConvert.ToString(((ArrayList)p_SourceObject[i])[0]))
                 {
                 case FUISourceObject.SourceQueryCondition:    //查询条件刷新
                     _HTDataConditionStr = SysConvert.ToString(((ArrayList)p_SourceObject[i])[1]);
                     this.BindGrid();
                     break;
                 }
             }
         }
     }
     catch
     {
     }
 }
Пример #17
0
    protected void btn_Exec_Click(object sender, EventArgs e)
    {
        fmStatus = FormStatus.fmProcess;

        try
        {
            if (CheckInputValuesNotNull() && CheckItemClassValid())
            {
                ALOModel.MaintainPatternSpec BCO = new PIC.VDS2G.BSM.ALO.MaintainPatternSpec(ConnectionDB);
                bool bResult=false;

                if (SLP_Pattern1.Text.Trim() == "" && SLP_Pattern2.Text.Trim() == "")
                {
                    bResult = BCO.CopyToNewPMA(GetInputValues(), null);
                }
                else if (SLP_Pattern1.Text.Trim() != "" && SLP_Pattern2.Text.Trim() != "")
                {
                    bResult = BCO.CopyToNewPattern(GetInputValues(), null);
                }            
                
                if (bResult)
                {
                    ErrorMsgLabel.Text = "";
                    ResultMsgLabel.Text = "複製成功";
                }
                else
                {
                    ErrorMsgLabel.Text = "";
                    ResultMsgLabel.Text = "複製失敗";
                }
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            fmStatus = FormStatus.fmBrowse;
        }


    }
Пример #18
0
    /// <summary>
    /// 表單狀態
    /// </summary>
    /// <param name="ProcFormStatus"></param>
    protected void FormStatusControl(FormStatus ProcFormStatus)
    {
        switch (ProcFormStatus)
        {
            case FormStatus.Query:
                #region 查詢UI狀態

                FormStatusHidden.Value = "Query";
                PanelQueryViewBtn.Visible = true;
                PanelAddEditBtn.Visible = false;
                SettingControlEnableAndReadOnly(TabPanel1, true);
                SetupConfirmBtn.Enabled = false;
                UpdatePanel_ItemGridView.Visible = true;
                UpdatePanel_ItemDetailDataProcBtn.Visible = false;
                DetailSingleStoreChainBtn.Disabled = true;
                SettingControlEnableAndReadOnly(TabPanel2, false);
                //清空頁面上的值
                SettingControlClearValue(TabPanel1);
                SettingControlClearValue(TabPanel2);

                //參照品項新增區塊隱藏
                Table_RefAdd.Visible = false;
                ALORefItemClearBind();
                //通路新增區塊隱藏
                Table_StoreChainAdd.Visible = false;
                ALOStoreChainClearBind();

                //設定ToolBar URL
                GMToolbar1.SetupURL(Application["AppSite_RootDir"] + "ALO/ALO111.aspx?Code=ALO11",
                                    ""
                                    );

                //設定ToolBar的按鈕
                GMToolbar1.SetupControl(null,
                                        null,
                                        null,
                                        null,
                                        null
                                        );

                //設定ToolBar 狀態
                GMToolbar1.GMToolbarStatus = WUI_GMToolbarV.GMToolbarStatusEnum.Find;

                //將新增的按鈕重新設定
                GMToolbar1.ButtonEnableControl(WUI_GMToolbarV.ButtonType.New,
                                               true,
                                               "",
                                               SetupAddBtn,
                                               WUI_GMToolbarV.ClickAction.ButtonClick
                                               );

                #endregion
                break;
            case FormStatus.View:
                #region 檢視UI狀態

                bool ConfirmData = (SLP_ApproveDate.Text != "") ? true : false;
                FormStatusHidden.Value = "View";
                //配本序號UI控制
                PanelQueryViewBtn.Visible = true;
                PanelAddEditBtn.Visible = false;
                SettingControlEnableAndReadOnly(TabPanel1, false);
                SetupConfirmBtn.Enabled = !ConfirmData;
                SetupAddBtn.Enabled = true;
                SetupQueryBtn0.Disabled = true;
                //配本商品UI控制
                UpdatePanel_ItemGridView.Visible = true;
                SettingControlEnableAndReadOnly(TabPanel2, false);
                SettingControlEnableAndReadOnly(PanelDetail, true);
                SessionIDName = "ALO111ItemGridViewDv_" + PageTimeStamp.Value;
                DataView dv = (DataView)Session[SessionIDName];
                dv.RowFilter = "";//2010/04/07 added

                if (dv != null && dv.Count > 0)
                {
                    SettingControlEnableAndReadOnly(PanelItemDetailControlBtn, true);
                    SessionShowItemIndex = "ALO111ShowItemIndex_" + PageTimeStamp.Value;
                    int ShowItemIndex = (int)Session[SessionShowItemIndex];
                    //設定巡覽列
                    ItemNavigateProcess(dv, ShowItemIndex);
                    DetailAddBtn.Enabled = !ConfirmData;
                    //配本功能區設定
                    SettingControlEnableAndReadOnly(ALOBusinessFunction, true);

                    ALOBusinessFunctionBtnEnable(ALOBusinessFunction);
                    UpdatePanel_ItemDetailDataProcBtn.Visible = !ConfirmData;
                    SettingControlEnableAndReadOnly(UpdatePanel_ItemDetailDataProcBtn, !ConfirmData);

                    #region 如果通路無配本方式

                    #region 使用XML轉回DataSet

                    DataSet Ds = new DataSet();
                    DataTable StoreChainDt = null;
                    if (XML_StoreChainList.InnerHtml != "")
                    {
                        System.IO.StringReader sr = new System.IO.StringReader(XML_StoreChainList.InnerHtml);
                        Ds.ReadXml(sr);
                    }

                    if (Ds.Tables.Count > 0)
                    {
                        StoreChainDt = Ds.Tables[0];
                    }

                    #endregion

                    if (StoreChainDt != null && StoreChainDt.Rows.Count > 0)
                    {
                        for (int x = 0; x < StoreChainDt.Rows.Count; x++)
                        {
                            //如果DIS_TYPE為空值 且 資料來源為一般
                            if (StoreChainDt.Rows[x]["DIS_TYPE"].ToString() == "" && iDataSource == 0)//2010/03/01 modified: for ALO14's imported data; original:if (StoreChainDt.Rows[x]["DIS_TYPE"].ToString() == "")
                            {
                                SettingControlEnableAndReadOnly(UpdatePanel_ItemDetailDataProcBtn, false);
                                break;
                            }
                        }
                    }

                    #endregion
                }
                else
                {
                    DetailAddBtn.Enabled = true;//2010/02/26 added:when GridView_ItemList.Rows.Counts <=0 then Enable the "DetailAddBtn".
                }


                //2010/03/03 added
                if (iDataSource != 0)
                {
                    DetailAddBtn.Enabled = false;//新增商品
                    BusBtn_ReturnRate.Enabled = false;//退容率設定
                    BusBtn_CalcDisQty.Enabled = false;//配量計算
                }


                //參照品項新增區塊隱藏
                Table_RefAdd.Visible = false;
                //通路新增區塊隱藏
                Table_StoreChainAdd.Visible = false;

                //設定ToolBar URL
                GMToolbar1.SetupURL(Application["AppSite_RootDir"] + "ALO/ALO111.aspx?Code=ALO11",
                                    ""
                                    );

                //設定ToolBar的按鈕
                GMToolbar1.SetupControl(null,
                                        null,
                                        null,
                                        null,
                                        (dv.Count > 0) ? ItemEditBtn : null
                                        );

                //檢視模式
                GMToolbar1.GMToolbarStatus = WUI_GMToolbarV.GMToolbarStatusEnum.ViewOne;

                //將新增的按鈕重新設定(新增配本序號)
                GMToolbar1.ButtonEnableControl(WUI_GMToolbarV.ButtonType.New,
                                               true,
                                               "",
                                               SetupAddBtn,
                                               WUI_GMToolbarV.ClickAction.ButtonClick
                                               );

                #region 判斷未確認資料是否有做過門市檢核,沒做過就無法確認

                if (!ConfirmData) //如果未確認
                {
                    if (Session[string.Format("{0}_{1}", SessionCheckStoreIDName, PageTimeStamp.Value)] != null)
                    {
                        if (Session[string.Format("{0}_{1}", SessionCheckStoreIDName, PageTimeStamp.Value)] != "1")
                        {
                            SetupConfirmBtn.Enabled = false;
                        }
                        else
                        {
                            SetupConfirmBtn.Enabled = true;
                        }
                    }
                    else
                    {
                        SetupConfirmBtn.Enabled = false;
                    }
                }

                #endregion

                #endregion
                break;
            case FormStatus.Add:
                #region 新增UI狀態

                FormStatusHidden.Value = "Add";
                //清空頁面上的值
                SettingControlClearValue(TabPanel1);
                SettingControlClearValue(TabPanel2);

                #region 配本序號

                //配本序號UI控制
                SettingControlClearValue(TabPanel1);
                PanelQueryViewBtn.Visible = false;
                PanelAddEditBtn.Visible = true;
                SettingControlEnableAndReadOnly(TabPanel1, false);
                SettingControlEnableAndReadOnly(SLP_STAcceptDate, true);
                SettingControlEnableAndReadOnly(PanelAddEditBtn, true);

                //欄位預設值
                //配本日期預設值
                SLP_DISDate.Text = DateTime.Today.ToShortDateString();
                //門市進貨日預設值
                SLP_STAcceptDate.Text = DateTime.Today.AddDays(1).ToShortDateString();

                #endregion

                #region 配本商品

                //配本商品UI控制
                UpdatePanel_ItemGridView.Visible = false;
                SettingControlEnableAndReadOnly(PanelItemDetailControlBtn, false);
                SettingControlEnableAndReadOnly(PanelItemDetail1, false);
                //商品可修改
                SettingControlEnableAndReadOnly(SLP_SKU1, true);
                //期別可修改
                SettingControlEnableAndReadOnly(SLP_ItemPeriod1, true);
                SettingControlClearValue(PanelItemDetail1);

                SettingControlEnableAndReadOnly(PanelItemDetail2, true);
                SettingControlClearValue(PanelItemDetail2);
                DetailSingleStoreChainBtn.Disabled = true;
                AsyncPostBackTrigger a = new AsyncPostBackTrigger();
                a.ControlID = SLP_EnumBase_ChanType.RadioButtonListControl.ID;
                a.EventName = "SelectedIndexChanged";
                UpdatePanel_ItemDetailDataChanType.Triggers.Add(a);
                //檢視刪除按鈕列不顯示
                UpdatePanel_ItemDetailDataProcBtn.Visible = false;

                //配本商品預設值
                DIS_STOQTYtxt.Text = "0";
                //採購數預設值
                DIS_ISUQTYtxt.Text = "0";
                //預留數預設值
                DIS_MDCQTYtxt.Text = "0";
                //保留數預設值
                ReserveQTYtxt.Text = "0";
                //實配數預設值
                DISQTYtxt.Text = "0";
                //到貨數預設值
                AcceptQTYtxt.Text = "0";
                //處理階段
                OPStatusHidden.Value = "0";
                //計算未生效
                SLP_Boolean_CountNoEff.Text = "1";

                #endregion

                #region 配本參照商品

                //配本參照商品UI控制
                DetailAddRefBtn.Enabled = false;
                DetailConfirmRefBtn.Enabled = true;
                SettingControlEnableAndReadOnly(UpdatePanel_RefItemList, true);
                //參照品項新增區塊隱藏
                Table_RefAdd.Visible = false;

                #endregion

                #region 配本通路

                //配本通路UI控制
                DetailAddStoreChainBtn.Enabled = true;
                SettingControlEnableAndReadOnly(UpdatePanel_StoreChainList, true);
                //通路新增區塊隱藏
                Table_StoreChainAdd.Visible = false;

                #endregion

                #region 配本功能區

                //配本功能區UI控制
                SettingControlEnableAndReadOnly(ALOBusinessFunction, false);

                #endregion

                #region 設定ToolBar

                //設定ToolBar URL
                GMToolbar1.SetupURL(Application["AppSite_RootDir"] + "ALO/ALO111.aspx?Code=ALO11",
                                    ""
                                    );

                //設定ToolBar的按鈕
                GMToolbar1.SetupControl(null,
                                        null,
                                        SaveBtn,
                                        null,
                                        null
                                        );
                //新增模式
                GMToolbar1.GMToolbarStatus = WUI_GMToolbarV.GMToolbarStatusEnum.NewEdit;

                //將新增的按鈕重新設定(關閉新增按鈕)
                GMToolbar1.ButtonEnableControl(WUI_GMToolbarV.ButtonType.New,
                                               false,
                                               "",
                                               SetupAddBtn,
                                               WUI_GMToolbarV.ClickAction.ButtonClick
                                               );

                #endregion

                #region 清除POP視窗的Session

                ClearPopSession();

                #endregion

                #endregion
                break;
            case FormStatus.Edit:
                #region 編輯UI狀態

                FormStatusHidden.Value = "Edit";

                #region 配本序號

                //配本序號UI控制                
                PanelQueryViewBtn.Visible = false;
                PanelAddEditBtn.Visible = true;
                SettingControlEnableAndReadOnly(TabPanel1, false);
                SettingControlEnableAndReadOnly(SLP_STAcceptDate, true);
                SettingControlEnableAndReadOnly(PanelAddEditBtn, true);

                #endregion

                #region 配本商品

                //配本商品UI控制
                UpdatePanel_ItemGridView.Visible = false;
                SettingControlEnableAndReadOnly(PanelItemDetailControlBtn, false);
                SettingControlEnableAndReadOnly(PanelItemDetail1, false);
                if (iDataSource == 0)//2010/03/03 added
                {
                    SettingControlEnableAndReadOnly(PanelItemDetail2, true);
                }

                //查看目前的通路設定
                StoreChainCheck();
                AsyncPostBackTrigger b = new AsyncPostBackTrigger();
                b.ControlID = SLP_EnumBase_ChanType.RadioButtonListControl.ID;
                b.EventName = "SelectedIndexChanged";
                UpdatePanel_ItemDetailDataChanType.Triggers.Add(b);
                //檢視刪除按鈕列不顯示
                UpdatePanel_ItemDetailDataProcBtn.Visible = false;

                #endregion

                #region 配本參照商品

                //重新連結資料讓編輯及刪除按鈕生效
                ALOXMLRefItemBind();
                //配本參照商品UI控制
                DetailAddRefBtn.Enabled = false;
                if (iDataSource == 0)//2010/03/03 added
                {
                    DetailConfirmRefBtn.Enabled = true;
                    SettingControlEnableAndReadOnly(UpdatePanel_RefItemList, true);
                }
                //參照品項新增區塊隱藏
                Table_RefAdd.Visible = false;

                #endregion

                #region 配本通路

                //重新連結資料讓編輯及刪除按鈕生效
                ALOXMLStoreChainBind();
                //配本通路UI控制
                DetailAddStoreChainBtn.Enabled = true;
                SettingControlEnableAndReadOnly(UpdatePanel_StoreChainList, true);
                //通路新增區塊隱藏
                Table_StoreChainAdd.Visible = false;

                #endregion

                #region 配本功能區

                //配本功能區UI控制
                SettingControlEnableAndReadOnly(ALOBusinessFunction, false);

                #endregion

                #region 設定ToolBar

                //設定ToolBar URL
                GMToolbar1.SetupURL(Application["AppSite_RootDir"] + "ALO/ALO111.aspx?Code=ALO11",
                                    ""
                                    );

                ////設定ToolBar的按鈕
                GMToolbar1.SetupControl(null,
                                        null,
                                        SaveBtn,
                                        null,
                                        null
                                        );
                //修改模式
                GMToolbar1.GMToolbarStatus = WUI_GMToolbarV.GMToolbarStatusEnum.UpdateEdit;

                #endregion

                #region 判斷是否有做過門市檢核,有就清空SESSION,無法確認

                if (Session[string.Format("{0}_{1}", SessionCheckStoreIDName, PageTimeStamp.Value)] != null)
                {
                    if (Session[string.Format("{0}_{1}", SessionCheckStoreIDName, PageTimeStamp.Value)] == "1")
                    {
                        //清空SESSION
                        Session[string.Format("{0}_{1}", SessionCheckStoreIDName, PageTimeStamp.Value)] = null;
                        SetupConfirmBtn.Enabled = false;
                    }
                }
                else
                {
                    SetupConfirmBtn.Enabled = false;
                }

                #endregion



                if (iDataSource != 0)//2010/03/04 added
                {
                    //通路設定
                    ((RadioButtonList)SLP_EnumBase_ChanType.FindControl("R1")).Enabled = false;
                    DetailSingleStoreChainBtn.Disabled = true;

                    //新增通路
                    DetailAddStoreChainBtn.Enabled = false;
                    UpdatePanel_ItemDetailDataChanType.Update();
                }


                #endregion
                break;
            case FormStatus.EditForNewItem:
                #region 編輯新增項目UI狀態

                FormStatusHidden.Value = "EditForNewItem";

                #region 配本序號

                //配本序號UI控制                
                PanelQueryViewBtn.Visible = false;
                PanelAddEditBtn.Visible = true;
                SettingControlEnableAndReadOnly(TabPanel1, false);
                SettingControlEnableAndReadOnly(SLP_STAcceptDate, true);
                SettingControlEnableAndReadOnly(PanelAddEditBtn, true);

                #endregion

                #region 配本商品

                //配本商品UI控制
                UpdatePanel_ItemGridView.Visible = false;
                SettingControlEnableAndReadOnly(PanelItemDetailControlBtn, false);
                SettingControlEnableAndReadOnly(PanelItemDetail1, false);
                //商品可修改
                SettingControlEnableAndReadOnly(SLP_SKU1, true);
                //期別可修改
                SettingControlEnableAndReadOnly(SLP_ItemPeriod1, true);
                SettingControlClearValue(PanelItemDetail1);

                SettingControlEnableAndReadOnly(PanelItemDetail2, true);
                SettingControlClearValue(PanelItemDetail2);
                DetailSingleStoreChainBtn.Disabled = true;
                AsyncPostBackTrigger c = new AsyncPostBackTrigger();
                c.ControlID = SLP_EnumBase_ChanType.RadioButtonListControl.ID;
                c.EventName = "SelectedIndexChanged";
                UpdatePanel_ItemDetailDataChanType.Triggers.Add(c);
                //檢視刪除按鈕列不顯示
                UpdatePanel_ItemDetailDataProcBtn.Visible = false;

                //配本商品預設值
                DIS_STOQTYtxt.Text = "0";
                //採購數預設值
                DIS_ISUQTYtxt.Text = "0";
                //預留數預設值
                DIS_MDCQTYtxt.Text = "0";
                //保留數預設值
                ReserveQTYtxt.Text = "0";
                //實配數預設值
                DISQTYtxt.Text = "0";
                //到貨數預設值
                AcceptQTYtxt.Text = "0";
                //處理階段
                OPStatusHidden.Value = "0";
                //計算未生效
                SLP_Boolean_CountNoEff.Text = "1";

                #endregion

                #region 配本參照商品

                //重新連結資料讓編輯及刪除按鈕生效
                ALOXMLRefItemBind();
                //配本參照商品UI控制
                DetailAddRefBtn.Enabled = false;
                DetailConfirmRefBtn.Enabled = true;
                SettingControlEnableAndReadOnly(UpdatePanel_RefItemList, true);
                //參照品項新增區塊隱藏
                Table_RefAdd.Visible = false;

                #endregion

                #region 配本通路

                //重新連結資料讓編輯及刪除按鈕生效
                ALOXMLStoreChainBind();
                //配本通路UI控制
                DetailAddStoreChainBtn.Enabled = true;
                SettingControlEnableAndReadOnly(UpdatePanel_StoreChainList, true);
                //通路新增區塊隱藏
                Table_StoreChainAdd.Visible = false;

                #endregion

                #region 配本功能區

                //配本功能區UI控制
                SettingControlEnableAndReadOnly(ALOBusinessFunction, false);

                #endregion

                #region 設定ToolBar

                //設定ToolBar URL
                GMToolbar1.SetupURL(Application["AppSite_RootDir"] + "ALO/ALO111.aspx?Code=ALO11",
                                    ""
                                    );

                ////設定ToolBar的按鈕
                GMToolbar1.SetupControl(null,
                                        null,
                                        SaveBtn,
                                        null,
                                        null
                                        );
                //修改模式
                GMToolbar1.GMToolbarStatus = WUI_GMToolbarV.GMToolbarStatusEnum.UpdateEdit;

                #endregion

                #region 清除POP視窗的Session

                ClearPopSession();

                #endregion

                #endregion
                break;
        }
    }
Пример #19
0
 private void CloseFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ClearForm();
     status = FormStatus.Waiting;
 }
Пример #20
0
 public static String UpdateTitle(String title, FormStatus status)
 {
     bool IsDebug = FrameworkParams.isSupportDeveloper;
     if (IsDebug == false)
     {
         switch (status)
         {
             case FormStatus.NO:
                 title += " NO ";//+ frm.Text;
                 break;
             case FormStatus.NC:
                 title += " NC ";//+ frm.Text;
                 break;
             case FormStatus.OK_DEV:
                 title += " OK_DEV ";//+ frm.Text;
                 break;
             case FormStatus.OK_TEST:
                 title += " OK_TEST ";//+ frm.Text;
                 break;
             case FormStatus.FIX:
                 title += " FIX ";//+ frm.Text;
                 break;
             case FormStatus.FIXED:
                 title += " FIXED ";//+ frm.Text;
                 break;
         }
     }
     return title;
 }
Пример #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            ErrorMsgLabel.Text = "";
            ResultMsgLabel.Text = "";

            if (!IsPostBack)
            {

                if (Request.QueryString["PageTimeStamp"] != null)
                    PageTimeStamp.Value = Request.QueryString["PageTimeStamp"];
                else
                    PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}",
                                                        DateTime.Now.Year.ToString(),
                                                        DateTime.Now.Month.ToString().PadLeft(2, '0'),
                                                        DateTime.Now.Day.ToString().PadLeft(2, '0'),
                                                        DateTime.Now.Hour.ToString().PadLeft(2, '0'),
                                                        DateTime.Now.Minute.ToString().PadLeft(2, '0'),
                                                        DateTime.Now.Second.ToString().PadLeft(2, '0')
                                                        );

                fmStatus = FormStatus.fmBrowse;

                btn_Exec.Attributes.Add("onclick", string.Format("{1}SetFormStatus('{0}');", FormStatus.fmProcess.ToString(), "CheckBatchCopyIsTheSameKey();if(Page_IsValid==false){return false;}"));


                #region 設定TabIndex

                SLP_StoreChain1.TextBox_Code.TabIndex = 1;
                SLP_Store1.TextBox_Code.TabIndex = 2;
                SLP_StoreChain2.TextBox_Code.TabIndex = 3;
                SLP_Store2.TextBox_Code.TabIndex = 4;
                btn_Exec.TabIndex = 5;
                btn_Back.TabIndex = 6;
                #endregion


            }

            RegTextAttr();

            RegClientScript();

            ToolBarInit();

            AuthorityControls(this);
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }
 private void btnCancel_Click(object sender, EventArgs e)
 {
     FormStatus = WTFClassLibrary.FormStatus.Cancelled;
     this.Dispose();
 }
Пример #23
0
    private string ProcessMultiRemove(string strDisNoForAry, Int32 iProcessingAryIndex, string strUserID, string strPageTimeStamp)
    {
        #region

        bool bResult = false;
        string strDisNo = "", strNextDisNo = "";
        string[] strAryDisAry = strDisNoForAry.Split(";".ToCharArray());
        string strCallbackResult = "";
        string strResult = "", strErrMsg = "";
        string strPrefixed = "POP_DisApproveError";

        try
        {

            //於執行多筆確認、解除時清空,為了於換頁時可以取得最新資料
            string SessionIDName = string.Format("{0}_{1}", "CRM211_MST", strPageTimeStamp);
            Session[SessionIDName] = null;

            fmStatus = FormStatus.fmProcess;

            if (iProcessingAryIndex < strAryDisAry.Length)
            {

                strDisNo = strAryDisAry[iProcessingAryIndex];

                CRMModel.VDS_CRM21_BCO BCO = new CRMModel.VDS_CRM21_BCO(ConnectionDB);
                ArrayList ParameterList = new ArrayList();
                ParameterList.Clear();
                ParameterList.Add(strDisNo);
                ParameterList.Add(strUserID);
                ParameterList.Add(DateTime.Now);

                BCO.ProcessCancelConfirmForCrm21(ParameterList, out strResult, out strErrMsg, null);

                if (strResult == "1")//解除成功
                {
                    bResult = true;
                }
                else//解除失敗
                {
                    Session[string.Format("{0}_REMOVE_{1}", strPrefixed, strPageTimeStamp)] = strDisNo;
                    bResult = false;
                }

                iProcessingAryIndex = iProcessingAryIndex + 1;

                if (iProcessingAryIndex < strAryDisAry.Length)
                {
                    strNextDisNo = strAryDisAry[iProcessingAryIndex];
                }
                else
                {
                    strNextDisNo = "X";//表示已執行到最後一筆
                }

                //0:DIS_NO字串For陣列用-
                //1:下一筆陣列Index-
                //2:執行結果-
                //3:錯誤訊息-
                //4:要關閉執行狀態的DIS_NO-
                //5:要開啟執行狀態的DIS_NO-
                //6:是否有累積執行錯誤之DIS_NO


                strCallbackResult = string.Format("{0}-{1}-{2}-{3}-{4}-{5}-{6}",
                    strDisNoForAry,
                    iProcessingAryIndex,
                    bResult ? "OK" : "NG",
                    string.Format("{0}", strErrMsg),
                    strDisNo,
                    strNextDisNo,
                    Session[string.Format("{0}_REMOVE_{1}", strPrefixed, strPageTimeStamp)] == null ? "0" : "1"
                    );
            }

        }
        catch (Exception ex)
        {
            throw new Exception(string.Format("{0}||{1}", strDisNo, ex.Message));
        }

        return strCallbackResult;
        #endregion
    }
Пример #24
0
        private void SessionBrowser_DoubleClick(object sender, System.EventArgs e)
        {
            if (this.button_clicked == MouseButtons.Left)
            {
                string  script="";
                string  emulator = "";
                string  media_file = "";
                string  results="";

                TreeNode tree_node = this.SessionBrowser.SelectedNode;
                if (tree_node != null)
                {
                    // An item in the tree has been selected.
                    this.GetNodeProperties (tree_node, out script, out emulator, out media_file, out results);
                    if (results != "")
                    {
            //                        this.last_selected_result = tree_node;
                        this.ButtonDetailedValidation.Checked = true;
                    }
                    else if (script != "")
                    {
                        if (this.selected_session is Dvtk.Sessions.ScriptSession)
                        {
            //                            this.last_selected_script = tree_node;

                            FileInfo fileInfo = new FileInfo (script);

                            this._process_status = FormStatus.script_running;

                            // Update the UI to reflect that a script is executing
                            this.UpdateUIProcessRunning ();

                            //this.selected_session.StartResultsGathering (this.selected_session.SessionId.ToString ("000") + '_' + file.Name.Replace ('.', '_') + "_res.xml");
                            this.selected_session.StartResultsGatheringWithExpandedFileNaming(fileInfo.Name);

                            // Execute the selected script. This needs to be
                            // done in a seperate thread; we don't want the
                            // entire application to stall.
                            this.selected_script =
                                System.IO.Path.Combine(
                                (this.selected_session as Dvtk.Sessions.ScriptSession).DicomScriptRootDirectory,
                                script);

                            if ((fileInfo.Extension == ".ts") ||
                                (fileInfo.Extension == ".ds") ||
                                (fileInfo.Extension == ".dss"))
                            {
                                this.script_thread = null;
                                System.AsyncCallback cb = new AsyncCallback(this.OnScriptDone);
                                System.IAsyncResult ar =
                                ((Dvtk.Sessions.ScriptSession)this.selected_session).BeginExecuteScript(
                                    this.selected_script,
                                    false,
                                    cb);
                            }
                            else if (fileInfo.Extension == ".js")
                            {
                                this.script_thread = new Thread (new ThreadStart (this.ExecuteJSScript));
                                this.script_thread.Start();
                            }
                            else if (fileInfo.Extension == ".vbs")
                            {
                                this.script_thread = new Thread (new ThreadStart (this.ExecuteVBSScript));
                                this.script_thread.Start();
                            }
                        }
                    }
                    else
                    {
                        this._active_page = ActivePage.session;
            //                        this.last_selected_session = tree_node;
                        this.ButtonGeneralInformation.Checked = true;
                        this.UpdateSessionProperties ();
                        this.UpdatePageVisibility ();
                    }
                }
            }
        }
Пример #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region
        try
        {

            ErrorMsgLabel.Text = "";
            ResultMsgLabel.Text = "";

            if (!IsPostBack)
            {

                if (Request.QueryString["PageTimeStamp"] != null)
                    PageTimeStamp.Value = Request.QueryString["PageTimeStamp"];
                else
                    PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}",
                                                        DateTime.Now.Year.ToString(),
                                                        DateTime.Now.Month.ToString().PadLeft(2, '0'),
                                                        DateTime.Now.Day.ToString().PadLeft(2, '0'),
                                                        DateTime.Now.Hour.ToString().PadLeft(2, '0'),
                                                        DateTime.Now.Minute.ToString().PadLeft(2, '0'),
                                                        DateTime.Now.Second.ToString().PadLeft(2, '0')
                                                        );


                fmStatus = FormStatus.fmBrowse;
                btn_Exec.Attributes.Add("onclick", string.Format("Page_ClientValidate();ClearAllMsg();{1}SetFormStatus('{0}');", FormStatus.fmProcess.ToString(), "CheckBatchCopyIsTheSameKey();if(Page_IsValid==false){return false;}"));
                rbtn_CopyStore.Attributes.Add("onclick", "ClearAllMsg();ResetCopyMode();Page_ClientValidate();");
                rbtn_CopyPattern.Attributes.Add("onclick", "ClearAllMsg();ResetCopyMode();Page_ClientValidate();");


                Image img_ChanOld = (Image)((ASP.stm_slp_slp_storechain_ascx)SLP_StoreChain1).FindControl("Image1");//通路OLD img
                Image img_ChanNew = (Image)((ASP.stm_slp_slp_storechain_ascx)SLP_StoreChain2).FindControl("Image1");//通路NEW img
                Image img_StoreOld = (Image)((ASP.stm_slp_slp_store_ascx)SLP_Store1).FindControl("Image1");//門市OLD img
                Image img_StoreNew = (Image)((ASP.stm_slp_slp_store_ascx)SLP_Store2).FindControl("Image1");//門市NEW img
                Image img_PatternOld = (Image)((PIC.VDS2G.WebUI.SLP.SLP_Pattern)SLP_Pattern1).FindControl("Image1");//PatternOLD img
                Image img_PatternNew = (Image)((PIC.VDS2G.WebUI.SLP.SLP_Pattern)SLP_Pattern2).FindControl("Image1");//PatternNEW img


                string strJS = string.Format("PO_ALO033.img_ChanOld_ID='{0}';PO_ALO033.img_ChanNew_ID='{1}';PO_ALO033.img_StoreOld_ID='{2}';PO_ALO033.img_StoreNew_ID='{3}';PO_ALO033.img_PatternOld_ID='{4}';PO_ALO033.img_PatternNew_ID='{5}';",
                    img_ChanOld.ClientID, img_ChanNew.ClientID, img_StoreOld.ClientID, img_StoreNew.ClientID, img_PatternOld.ClientID, img_PatternNew.ClientID);

                ScriptManager.RegisterStartupScript(this, this.GetType(), "JS", strJS, true);


                #region 設定TabIndex

                rbtn_CopyStore.TabIndex = 1;
                SLP_StoreChain1.TextBox_Code.TabIndex = 2;
                SLP_Store1.TextBox_Code.TabIndex = 3;
                SLP_StoreChain2.TextBox_Code.TabIndex = 4;
                SLP_Store2.TextBox_Code.TabIndex = 5;
                rbtn_CopyPattern.TabIndex = 6;
                SLP_Pattern1.TextBox_Code.TabIndex = 7;
                SLP_Pattern2.TextBox_Code.TabIndex = 8;
                btn_Exec.TabIndex = 9;
                btn_Back.TabIndex = 10;
                #endregion

            }

            RegTextAttr();

            RegClientScript();

            ToolBarInit();

            AuthorityControls(this);
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
Пример #26
0
 //修改
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     BtnControl(false);
     TxtControl(true);
     status = FormStatus.Update;
 }
Пример #27
0
 public FapFreeForm(IServiceProvider serviceProvider, string id, FormStatus formStatus = FormStatus.Add) : base(serviceProvider, id, formStatus)
 {
 }
Пример #28
0
 public _Table(DataRow drDataRow, FormStatus fsFormStatus = FormStatus.fsMain) : base(drDataRow, fsFormStatus)
 {
     Permission = User._Permission.GetPermission(User.WorkGroupCode, PK_TableCode);
 }
Пример #29
0
 /// <summary>
 /// 转向目标页
 /// </summary>
 public void NavigateWin(string p_FormClassName, string p_ParentID, FormStatus p_MFormStatus)
 {
     MDIForm.ContextMenuOpenForm(FUISourceObject.GetResultArrayList(FUISourceObject.SourceForm, this), p_FormClassName, this.FormListAID, this.FormListBID, this.SubmitFlag, this.AuditFlag, p_ParentID, p_MFormStatus);
 }
Пример #30
0
 /// <summary>
 /// Constructs a CtrlStatusMgrCall object.
 /// </summary>
 public CtrlStatusMgrCall(ControlStatusManager statusMgr, FormStatus newStatus)
 {
     this.statusMgr = statusMgr;
     this.newStatus = newStatus;
 }
Пример #31
0
 //刪除
 private void btnDelete_Click(object sender, EventArgs e)
 {
     BtnControl(false);
     status = FormStatus.Delete;
 }
Пример #32
0
        /// <summary>
        /// 外部窗体初始化数据
        /// </summary>
        /// <param name="p_OpenSourceID">打开窗体源实体ID</param>
        /// <param name="p_TargetID">打开窗体目标实体ID</param>
        public override void OutIniDataStrong(ArrayList p_SourceObject, string p_OpenSourceID, string p_TargetID, FormStatus p_MFormStatus) //右键菜单打开代码
        {
            try                                                                                                                             //赋值,父窗体,防止非查询结果集窗体
            {
                if (p_SourceObject != null)
                {
                    for (int i = 0; i < p_SourceObject.Count; i++)
                    {
                        switch (SysConvert.ToString(((ArrayList)p_SourceObject[i])[i]))
                        {
                            //case FUISourceObject.SourceForm://数据源Form
                            //    HTParentForm = (frmAPBaseUIWHForm)p_SourceForm;
                            //    break;
                        }
                    }
                }
            }
            catch
            {
            }

            if (p_OpenSourceID != string.Empty && p_OpenSourceID != HTDataID.ToString())
            {
                HTDataID = SysConvert.ToInt32(p_OpenSourceID);
                //EntitySet();

                SetPosStatus(HTDataID);
            }
            HTFormStatus = p_MFormStatus;
            switch (p_MFormStatus)
            {
            case FormStatus.新增:
                btnInsert_Click(null, null);
                break;

            case FormStatus.修改:
                btnUpdate_Click(null, null);
                break;

            default:
                SetFormStatus(p_MFormStatus);
                break;
            }
        }
Пример #33
0
        //確認
        private void btnCommit_Click(object sender, EventArgs e)
        {
            try
            {
                if (status == FormStatus.Insert)
                {
                    //產生出貨編號
                    string ID = createDeliveryID();

                    string cmd = "INSERT INTO Delivery" +
                                 "(DeliveryID,DeliveryDate,CustomerID,JoinMan,DeliveryType" +
                                 ",InvoiceNo,SubTotal,ValueAddTax,ShipAddress,Comment)VALUES" +
                                 "('" + ID + "','"
                                 + txtDate.Text + "','"
                                 + txtCustomer.Text + "','"
                                 + txtJoinMan.Text + "','"
                                 + txtDeliveryType.Text + "','"
                                 + txtInvoiceNo.Text + "','"
                                 + txtSubTotal.Text + "','"
                                 + txtValueAddTax.Text + "','"
                                 + txtAddress.Text + "','"
                                 + txtComment.Text
                                 + "')";

                    dao.ExcuteNonQuery(cmd);

                    TxtControl(false);
                }

                if (status == FormStatus.Delete)
                {
                    DataTable dtDetail = dao.Query("SELECT * FROM DeliveryDetails WHERE DeliveryID = '" + txtDeliveryID.Text + "'");

                    if (dtDetail.Rows.Count > 0)
                    {
                        MessageBox.Show("尚有細項無法刪除,請於畫面右上角編輯細項");
                    }
                    else
                    {
                        string cmd = "DELETE FROM Delivery WHERE DeliveryID = '" + txtDeliveryID.Text + "'";

                        dao.ExcuteNonQuery(cmd);
                    }
                }

                if (status == FormStatus.Update)
                {
                    string cmd = "UPDATE Delivery SET " +
                                 "DeliveryDate = '" + txtDate.Text + "'," +
                                 "CustomerID = '" + txtCustomer.Text + "'," +
                                 "JoinMan = '" + txtJoinMan.Text + "'," +
                                 "DeliveryType = '" + txtDeliveryType.Text + "'," +
                                 "InvoiceNo = '" + txtInvoiceNo.Text + "'," +
                                 "SubTotal = '" + txtSubTotal.Text + "'," +
                                 "ValueAddTax = '" + txtValueAddTax.Text + "'," +
                                 "ShipAddress = '" + txtAddress.Text + "'," +
                                 "Comment = '" + txtComment.Text + "'" +
                                 "WHERE DeliveryID = '" + txtDeliveryID.Text + "'";

                    dao.ExcuteNonQuery(cmd);
                    TxtControl(false);
                }

                DataRefresh();
                status = FormStatus.Query;
                BtnControl(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Пример #34
0
        /// <summary>
        /// 设置操作按钮状态
        /// </summary>
        public void SetToolButtonStatus(FormStatus p_Status, int p_FormSubmitFlag, int p_DelFlag)
        {
            this.HTFormStatus = p_Status;
            bool       p_SubmitFlag   = this.SubmitFlag;
            bool       p_AuditFlag    = this.AuditFlag;
            ButtonItem p_Insert       = ToolBarItemGet(-1, ToolButtonName.btnInsert.ToString());
            ButtonItem p_Update       = ToolBarItemGet(-1, ToolButtonName.btnUpdate.ToString());
            ButtonItem p_Delete       = ToolBarItemGet(-1, ToolButtonName.btnDelete.ToString());
            ButtonItem p_Save         = ToolBarItemGet(-1, ToolButtonName.btnSave.ToString());
            ButtonItem p_Drop         = ToolBarItemGet(-1, ToolButtonName.btnCancel.ToString());
            ButtonItem p_Submit       = ToolBarItemGet(-1, ToolButtonName.btnSubmit.ToString());
            ButtonItem p_CancelSubmit = ToolBarItemGet(-1, ToolButtonName.btnSubmitCancel.ToString());
            ButtonItem p_AuditPass    = ToolBarItemGet(-1, ToolButtonName.btnAudit.ToString());
            ButtonItem p_AuditRefuse  = ToolBarItemGet(-1, ToolButtonName.btnAuditCancel.ToString());
            ButtonItem p_FormCancel   = ToolBarItemGet(-1, ToolButtonName.btnFormCancel.ToString());
            ButtonItem p_FormRestore  = ToolBarItemGet(-1, ToolButtonName.btnFormRestore.ToString());

            ButtonItem p_AddRow = ToolBarItemGet(-1, ToolButtonName.btnAddRow.ToString());
            ButtonItem p_DelRow = ToolBarItemGet(-1, ToolButtonName.btnDelRow.ToString());


            ButtonItem p_First = ToolBarItemGet(-1, ToolButtonName.btnFirst.ToString());
            ButtonItem p_Pre   = ToolBarItemGet(-1, ToolButtonName.btnPre.ToString());
            ButtonItem p_Next  = ToolBarItemGet(-1, ToolButtonName.btnNext.ToString());
            ButtonItem p_Last  = ToolBarItemGet(-1, ToolButtonName.btnLast.ToString());

            p_First.Enabled = false;
            p_Pre.Enabled   = false;
            p_Next.Enabled  = false;
            p_Last.Enabled  = false;



            p_Insert.Enabled = false;
            p_Update.Enabled = false;
            p_Delete.Enabled = false;

            p_Save.Enabled = false;
            p_Drop.Enabled = false;

            if (!p_AuditFlag)//不需要审核
            {
                p_AuditPass.Visible   = false;
                p_AuditRefuse.Visible = false;
            }
            if (!p_SubmitFlag)//不需要提交
            {
                p_Submit.Visible       = false;
                p_CancelSubmit.Visible = false;
            }

            p_FormCancel.Enabled  = false;
            p_FormRestore.Enabled = false;

            p_AddRow.Enabled = false;
            p_DelRow.Enabled = false;

            switch (p_Status)
            {
            case FormStatus.查询:
                this.HTDataID = SysConvert.ToInt32(this.SetToolButtonPosStatus(this.HTDataID.ToString(), HTDataTableName));    //设置单据张数导航定位状态

                if (p_DelFlag == 0)
                {
                    p_FormCancel.Enabled = true;
                }
                else
                {
                    p_FormRestore.Enabled = true;
                }

                p_Insert.Enabled = true;
                switch (p_FormSubmitFlag)    //当前单据状态
                {
                case (int)ConfirmFlag.未提交:
                    if (p_SubmitFlag)        //需要提交 如果不需要提交的话就不存在未提交状态的可能
                    {
                        p_Update.Enabled = true;
                        p_Delete.Enabled = true;

                        p_Submit.Enabled       = true;
                        p_CancelSubmit.Enabled = false;
                        p_AuditPass.Enabled    = false;
                        p_AuditRefuse.Enabled  = false;
                    }
                    else
                    {
                        p_Update.Enabled = true;
                        p_Delete.Enabled = true;
                    }
                    break;

                case (int)ConfirmFlag.已提交:        //已提交,可以撤销提交,可以被审核

                    p_Submit.Enabled       = false;
                    p_CancelSubmit.Enabled = true;
                    p_AuditPass.Enabled    = true;
                    p_AuditRefuse.Enabled  = true;
                    break;

                case (int)ConfirmFlag.审核通过: //审核通过只能出现审核拒绝
                    if (p_AuditFlag)        //需要审核
                    {
                        p_Submit.Enabled       = false;
                        p_CancelSubmit.Enabled = false;
                        p_AuditPass.Enabled    = false;
                        p_AuditRefuse.Enabled  = true;
                    }
                    else                  //不需要审核
                    {
                        if (p_SubmitFlag) //需要提交
                        {
                            p_Submit.Enabled       = false;
                            p_CancelSubmit.Enabled = true;
                        }
                        else        //不需要提交
                        {
                            p_Update.Enabled = true;
                            p_Delete.Enabled = true;
                        }
                    }
                    break;

                case (int)ConfirmFlag.审核拒绝:        //审核拒绝出现审核通过或者可以更新

                    p_Submit.Enabled       = false;
                    p_CancelSubmit.Enabled = false;
                    p_AuditPass.Enabled    = true;
                    p_AuditRefuse.Enabled  = false;

                    p_Update.Enabled = true;
                    p_Delete.Enabled = true;
                    break;
                }

                break;

            case FormStatus.新增:
                p_Save.Enabled = true;
                p_Drop.Enabled = true;

                p_AddRow.Enabled = true;
                p_DelRow.Enabled = true;


                p_Submit.Enabled       = false;
                p_CancelSubmit.Enabled = false;
                p_AuditPass.Enabled    = false;
                p_AuditRefuse.Enabled  = false;
                break;

            case FormStatus.修改:
                p_Save.Enabled = true;
                p_Drop.Enabled = true;

                p_AddRow.Enabled = true;
                p_DelRow.Enabled = true;


                p_Submit.Enabled       = false;
                p_CancelSubmit.Enabled = false;
                p_AuditPass.Enabled    = false;
                p_AuditRefuse.Enabled  = false;
                break;

            case FormStatus.放弃:
                goto case FormStatus.查询;
            }


            BaseToolBar.Refresh();
        }
 private void ConvertMediaForm_Load(object sender, EventArgs e)
 {
     _Status = FormStatus.Open;
 }
Пример #36
0
 private void IndexFileForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     _Status = FormStatus.Closed;
 }
 public ConsentInformation(ConsentStatus consentStatus, ConsentType consentType, FormStatus formStatus)
 {
     ConsentStatus = consentStatus;
     ConsentType   = consentType;
     FormStatus    = formStatus;
 }
Пример #38
0
 private void IndexFileForm_Load(object sender, EventArgs e)
 {
     _Status = FormStatus.Open;
 }
Пример #39
0
        /// <summary>
        /// 提交、撤销提交、审核、审核拒绝、校验
        /// </summary>
        /// <returns></returns>
        private bool HTSubmitCheck(FormStatus p_OPStatus)
        {
            string    sql            = "SELECT SubmitFlag,DelFlag FROM " + _HTDataTableName + " WHERE ID=" + SysString.ToDBString(_HTDataID);
            DataTable dt             = SysUtils.Fill(sql);
            int       tempSubmitFlag = SysConvert.ToInt32(dt.Rows[0]["SubmitFlag"]);
            int       tempDelFlag    = SysConvert.ToInt32(dt.Rows[0]["DelFlag"]);

            if (dt.Rows.Count != 0)
            {
                if (tempDelFlag != 1)
                {
                    switch (p_OPStatus)
                    {
                    case FormStatus.提交:
                        if (tempSubmitFlag != (int)ConfirmFlag.未提交)
                        {
                            this.ShowMessage("不能操作,当前单据状态不是未提交");
                            return(false);
                        }
                        break;

                    case FormStatus.撤消提交:
                        if (this.AuditFlag)    //需要审核
                        {
                            if (tempSubmitFlag != (int)ConfirmFlag.已提交)
                            {
                                this.ShowMessage("不能操作,当前单据状态不是已提交");
                                return(false);
                            }
                        }
                        else    //不需要审核
                        {
                            if (tempSubmitFlag != (int)ConfirmFlag.审核通过)
                            {
                                this.ShowMessage("不能操作,当前单据状态不是已提交");
                                return(false);
                            }
                        }
                        break;

                    case FormStatus.审核通过:
                        if (!(tempSubmitFlag == (int)ConfirmFlag.已提交 || tempSubmitFlag == (int)ConfirmFlag.审核拒绝))
                        {
                            this.ShowMessage("不能操作,当前单据状态不是已提交或审核拒绝");
                            return(false);
                        }
                        break;

                    case FormStatus.审核拒绝:
                        if (!(tempSubmitFlag == (int)ConfirmFlag.已提交 || tempSubmitFlag == (int)ConfirmFlag.审核通过))
                        {
                            this.ShowMessage("不能操作,当前单据状态不是已提交或审核通过");
                            return(false);
                        }
                        break;
                    }
                }
                else
                {
                    this.ShowMessage("不能操作,当前单据已取消");
                    return(false);
                }
            }
            else
            {
                this.ShowMessage("不能操作,没有找到单据");
                return(false);
            }
            return(true);
        }
Пример #40
0
        /// <summary>
        /// 生成控件,切记获取值得控件要有 class='form-control'
        /// </summary>
        /// <returns></returns>
        public string BuilderForm(string frmid, int _colCount, bool isColspan, FormStatus formStatus = FormStatus.Add)
        {
            string lableName = _multiLangService.GetMultiLangValue(MultiLanguageOriginEnum.FapColumn, $"{_fapColumn.TableName}_{_fapColumn.ColName}");
            string ctrlName  = _fapColumn.ColName;

            //是否可编辑
            string editAble = string.Empty;

            if (_fapColumn.EditAble == 0 || ReadOnly)
            {
                editAble = "disabled='disabled'";
            }
            StringBuilder sbFormGroup = new StringBuilder();
            string        labelCol    = " col-sm-2 col-xs-12";

            if (formStatus == FormStatus.View)
            {
                labelCol = " col-sm-2 col-xs-2";
            }
            string ctrlOneCol = " col-xs-12 col-sm-10";
            string ctrlTwoCol = " col-xs-12 col-sm-4 ";

            if (formStatus == FormStatus.View)
            {
                ctrlOneCol = " col-xs-10 col-sm-10";
                ctrlTwoCol = " col-xs-4 col-sm-4 ";
            }
            if (_colCount == 1)
            {
                labelCol   = " col-sm-3 col-xs-12";
                ctrlTwoCol = ctrlOneCol = " col-xs-12 col-sm-9";
                if (formStatus == FormStatus.View)
                {
                    labelCol   = " col-sm-3 col-xs-3";
                    ctrlTwoCol = ctrlOneCol = " col-xs-9 col-sm-9";
                }
            }

            //一个控件占一行textarea,richtextbox
            if (isColspan)
            {
                //sbFormGroup.AppendLine("<div class=\"form-group col-xs-12 col-sm-12\">");

                sbFormGroup.AppendFormat("<label class=\"" + labelCol + " control-label no-padding-right\" for=\"{0}\">{1}", ctrlName, lableName);
                if (_fapColumn.NullAble == 0 && formStatus != FormStatus.View)
                {
                    sbFormGroup.Append("<i class='red'>*</i>");
                }
                if (formStatus == FormStatus.View)
                {
                    sbFormGroup.Append(":");
                }
                sbFormGroup.Append("</label>");

                sbFormGroup.AppendLine("<div class=\"ctrlcontainer " + ctrlOneCol + "\">");
            }
            else
            {
                //sbFormGroup.AppendLine(" <div class=\"form-group col-xs-12 col-sm-6\">");

                sbFormGroup.AppendFormat("<label class=\"" + labelCol + " control-label no-padding-right\" for=\"{0}\">{1}", ctrlName, lableName);

                if (_fapColumn.NullAble == 0 && formStatus != FormStatus.View)
                {
                    sbFormGroup.Append("<i class='red'>*</i>");
                }
                if (formStatus == FormStatus.View)
                {
                    sbFormGroup.Append(":");
                }
                sbFormGroup.Append("</label>");

                sbFormGroup.AppendLine("<div class=\"ctrlcontainer " + ctrlTwoCol + "\">");
            }

            if (formStatus == FormStatus.View)
            {
                sbFormGroup.AppendLine("<div class=\"text-info control-label align-left\">" + $"<label id=\"{ctrlName}\" >{BuilderFormFieldText()} </label>" + "</div>");
            }
            else
            {
                sbFormGroup.AppendLine("<div class='clearfix'>");
                BuilderDataFormField(frmid, lableName, editAble, sbFormGroup);
                sbFormGroup.AppendLine("</div>");
            }
            sbFormGroup.AppendLine("</div>");
            //sbFormGroup.AppendLine("</div>");

            return(sbFormGroup.ToString());
        }
Пример #41
0
    protected void btn_Exec_Click(object sender, EventArgs e)
    {
        fmStatus = FormStatus.fmProcess;

        try
        {
            if (CheckInputValuesNotNull())
            {
                ALOModel.MaintainPatternSpec BCO = new PIC.VDS2G.BSM.ALO.MaintainPatternSpec(ConnectionDB);
                bool bResult = BCO.CopyToNewStore(GetInputValues(), null);
                if (bResult)
                {
                    ResultMsgLabel.Text = "複製成功";
                }
                else
                {
                    ResultMsgLabel.Text = "複製失敗";
                }
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            fmStatus = FormStatus.fmBrowse;
        }


    }
Пример #42
0
 public AddDevice(FormStatus status)
 {
     _status = status;
     _device = new DeviceRepository();
     InitializeComponent();
 }
Пример #43
0
 private void ControlarComponentes(FormStatus status)
 {
     Confirma_bt.Visible = status == FormStatus.Create ? true : false;
     edit_bt.Visible     = status == FormStatus.Edit ? true : false;
 }
Пример #44
0
    protected void btn_Exec_Click(object sender, EventArgs e)
    {
        #region
        try
        {
            if (CheckInputValuesNotNull())
            {
                ALOModel.MaintainStoreSpec BCO = new PIC.VDS2G.BSM.ALO.MaintainStoreSpec(ConnectionDB);
                bool bResult = BCO.CopyToNewItem(GetInputValues(), null);
                if (bResult)
                {
                    ResultMsgLabel.Text = "複製成功";
                }
                else
                {
                    ResultMsgLabel.Text = "複製失敗, 無資料可複製, 請確認複製品號對應期別與商品主檔均已正確建立";
                }
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            fmStatus = FormStatus.fmBrowse;
        }
        #endregion

    }
Пример #45
0
    private string ProcessMultiConfirm(string strStAcceptDate, string strDisNoForAry, Int32 iProcessingAryIndex, string strUserID, string strPageTimeStamp)
    {
        #region
        string strDisNo = "", strNextDisNo = "";
        string[] strAryDisAry = strDisNoForAry.Split(";".ToCharArray());
        string strCallbackResult = "";
        string strResult = "", strErrMsg = "", strErrMsgFinal = "";
        string strPrefixed = "POP_DisApproveError";
        string strApproveDate = "";
        string strITEM_PERIOD_RESERVE_QTY = "";
        

        try
        {
            //於執行多筆確認、解除時清空,為了於換頁時可以取得最新資料
            string SessionIDName = string.Format("{0}_{1}", "CRM211_MST", strPageTimeStamp);
            Session[SessionIDName] = null;


            #region 檢查門市進貨日
            if (DateTime.Parse(strStAcceptDate) < DateTime.Today.AddDays(1))
            {
                strErrMsg += "門市進貨日必須大於系統日 ";
            }

            if (DateTime.Parse(strStAcceptDate).DayOfWeek == DayOfWeek.Sunday)
            {
                strErrMsg += "門市進貨日不可為星期日 ";
            }
            #endregion

            fmStatus = FormStatus.fmProcess;

            if (iProcessingAryIndex < strAryDisAry.Length)
            {
                //取得當前執行之 DISNO
                strDisNo = strAryDisAry[iProcessingAryIndex];

                if (strErrMsg == "")
                {
                    #region
                    CRMModel.VDS_CRM21_BCO BCO = new CRMModel.VDS_CRM21_BCO(ConnectionDB);
                    ArrayList ParameterList = new ArrayList();
                    ParameterList.Clear();
                    ParameterList.Add(strStAcceptDate);
                    ParameterList.Add(strDisNo);
                    ParameterList.Add("VDS_ALO_DIS_STORE");
                    ParameterList.Add(strUserID);

                    BCO.ProcessConfirmForCrm21(ParameterList, out strResult, out strErrMsg, null);

                    if ((strResult == "1") && (strErrMsg.Trim() == ""))//確認成功
                    {
                        strApproveDate = DateTime.Now.ToString("yyyy/MM/dd");

                        #region
                        ParameterList.Clear();
                        ParameterList.Add(strDisNo == "" ? null : strDisNo);
                        DataTable dtTemp = BCO.QueryDisCRMItemByDisNoForCrm21(ParameterList);
                        BCO.CloseConnection();

                        if (dtTemp != null && dtTemp.Rows.Count > 0)
                        {
                            for (Int32 i = 0; i <= dtTemp.Rows.Count - 1; i++)
                            {
                                strITEM_PERIOD_RESERVE_QTY += string.Format("{0}||{1}||{2},",
                                    dtTemp.Rows[i]["ITEM"].ToString(), dtTemp.Rows[i]["PERIOD"].ToString(), dtTemp.Rows[i]["RESERVE_QTY"].ToString());
                            }

                            if (strITEM_PERIOD_RESERVE_QTY.Trim() != "")
                            {
                                if (strITEM_PERIOD_RESERVE_QTY.Substring(strITEM_PERIOD_RESERVE_QTY.Length - 1, 1) == ",")
                                {
                                    strITEM_PERIOD_RESERVE_QTY = strITEM_PERIOD_RESERVE_QTY.Substring(0, strITEM_PERIOD_RESERVE_QTY.Length - 1);
                                }
                            }
                        }


                        #endregion

                    }
                    else if ((strResult == "1") && (strErrMsg.Trim() != ""))//確認失敗
                    {
                        #region 只要成功完成檢核,無論筆數 strResult 都=1, 所以要另外檢查strErrMsg 不為空值代表有檢核錯誤資料需要開POP
                        //Session[string.Format("{0}_DISNO_{1}", strPrefixed, strPageTimeStamp)] = strDisNo;
                        //Session[string.Format("{0}_OPTYPE_{1}", strPrefixed, strPageTimeStamp)] = "1";

                        Session[string.Format("{0}_DISNO_{1}", strPrefixed, strPageTimeStamp)] += string.Format("{0},", strDisNo);
                        Session[string.Format("{0}_OPTYPE_{1}", strPrefixed, strPageTimeStamp)] = "1";
                        Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strPageTimeStamp)] += string.Format("配本序號:{0},{1};\r\n", strDisNo, strErrMsg);

                        strResult = "0";
                        #endregion
                    }
                    #endregion
                }
                else 
                {
                    Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strPageTimeStamp)] += string.Format("配本序號:{0},{1};\r\n", strDisNo, strErrMsg);
                }

                iProcessingAryIndex = iProcessingAryIndex + 1;

                if (iProcessingAryIndex < strAryDisAry.Length)
                {
                    strNextDisNo = strAryDisAry[iProcessingAryIndex];
                }
                else
                {
                    strNextDisNo = "X";//表示已執行到最後一筆
                    strErrMsgFinal = Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strPageTimeStamp)] == null ? "" : Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strPageTimeStamp)].ToString();
                    Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strPageTimeStamp)] = null;
                }

                //0:DIS_NO字串For陣列用-
                //1:下一筆陣列Index-
                //2:執行結果-
                //3:錯誤訊息-
                //4:要關閉執行狀態的DIS_NO-
                //5:要開啟執行狀態的DIS_NO-
                //6:是否有累積執行錯誤之DIS_NO
                strCallbackResult = string.Format("{0}-{1}-{2}-{3}-{4}-{5}-{6}",
                    strDisNoForAry,
                    iProcessingAryIndex,
                    strResult == "1" ? "OK" : "NG",
                    strErrMsgFinal,
                    strDisNo,
                    strNextDisNo,
                    Session[string.Format("{0}_DISNO_{1}", strPrefixed, strPageTimeStamp)] == null ? "0" : "1"
                    );
            }
        }
        catch (Exception ex)
        {
            throw new Exception(string.Format("{0}||{1}", strDisNo, ex.Message));
        }

        return strCallbackResult;
        #endregion
    }
 public FormStatusChangedEventArgs(FormStatus status)
 {
     FrmStatus = status;
 }
Пример #47
0
 private void timerAct_Tick(object sender, EventArgs e)
 {
     if (frmstatus == FormStatus.Opening)
     {
         if (pct > 0)
         {
             this.Width = this.MaximumSize.Width / pct;
             pct--;
         }
         else
         {
             this.frmstatus = FormStatus.None;
             timerAct.Stop();
             this.MinimumSize = originMinSize;
         }
     }
     else if (frmstatus == FormStatus.Closing)
     {
         if (pct < 10)
         {
             this.Height = this.MaximumSize.Height / pct;
             pct++;
         }
         else
         {
             timerAct.Stop();
             this.Close();
         }
     }
 }
Пример #48
0
        private void InsertRecords(GoldenHand.GoldenHandContext context)
        {
            var c = context;

            #region formStatus
            FormStatus fs = new FormStatus();
            fs.FormStatusId = 0;
            fs.Name         = "Oczekuj¹ce";
            c.FormStatuses.AddOrUpdate(fs);

            fs = new FormStatus();
            fs.FormStatusId = 1;
            fs.Name         = "Wykonane";
            c.FormStatuses.AddOrUpdate(fs);

            fs = new FormStatus();
            fs.FormStatusId = 2;
            fs.Name         = "Rezygnacja";
            c.FormStatuses.AddOrUpdate(fs);
            c.SaveChanges();
            #endregion

            #region seniors
            AddSenior(c, "Kar³owicza 34", "Eugeniusz Konaszewski", "587 564 675");
            AddSenior(c, "Hallera 20/22", "Jan Kokoszko", "676543323");
            AddSenior(c, "Waszyngtona 43/98", "Nadzieja Ostatnia", "87 567 890");
            AddSenior(c, "Konopnickiej 78/4", "Luba Niemoja", "85 765 432");
            AddSenior(c, "Jarzêbinowa 14/12", "Wies³awa Szmal", "765 565 987");
            AddSenior(c, "Wiejska 6/9", "Krystyna Dzwon", "654 556 871");
            AddSenior(c, "Bia³ostoczek 13/3", "Marianna Zachlej", "767 998 098");
            AddSenior(c, "Sokólska 12/4", "Wies³awa Lama", "325667987");
            AddSenior(c, "Fabryczna 18/44", "Janina Kubica", "587 564 675");
            AddSenior(c, "Jasnego Grzyba 12/5", "Maria Ma³ysz", "587 564 675");
            AddSenior(c, "Wykwintna 18/90", "Teresa Stoch", "587 564 675");
            AddSenior(c, "Szkolna 12/6", "Genowefa Schumacher", "587 564 675");
            AddSenior(c, "Koœcielna 19/1", "Krystyna Aniston", "587 564 675");
            AddSenior(c, "Wojciecha 76/4", "Julia Roberts", "587 564 675");
            AddSenior(c, "Konwaliowa 12/3", "Marta Kotlet", "587 564 675");
            AddSenior(c, "Porzeczkowa 13/9", "Janina ŒledŸ", "587 564 675");
            AddSenior(c, "Szkolna 5/7", "Marianna Wódka", "587 564 675");
            AddSenior(c, "Cicha 1/4", "Janina Kac", "587 564 675");
            AddSenior(c, "Ukoœna 16/3", "Walentyna W¹¿", "587 564 675");
            AddSenior(c, "Marmurowa 33", "Martyna Wieloryb", "587 564 675");
            AddSenior(c, "Wiejska 7/9", "Teresa B¹czek", "587 564 675");
            AddSenior(c, "Konwaliowa 44/3", "Wiktoria Smalec", "587 564 675");
            AddSenior(c, "Wielka 3", "Aleksandra Morska", "587 564 675");
            AddSenior(c, "Ma³a 1", "Wies³aw Maruda", "587 564 675");
            AddSenior(c, "Skoœna 13/3", "Ignacy Pacyfik", "587 564 675");
            AddSenior(c, "Urlopowa 12", "Krystyna Czepialska", "587 564 675");
            AddSenior(c, "Pla¿owa 22/23", "Teresa Byk", "587 564 675");
            AddSenior(c, "Mieszka 23", "Marta Wirus", "587 564 675");
            AddSenior(c, "Chrobrego 1/4", "Janusz Tracz", "587 564 675");
            AddSenior(c, "Chrobrego 8/7", "Tadeusz Rydzyk", "587 564 675");
            AddSenior(c, "Ranna 5/9", "Wiktoria ¯y³a", "587 564 675");
            AddSenior(c, "Upalna 89/3", "Luba Wilk", "587 564 675");
            AddSenior(c, "Pogodna 4/76", "Maja Kawa", "587 564 675");
            AddSenior(c, "Skrajna 13/17", "Wies³awa Tusk", "587 564 675");
            AddSenior(c, "Szkolna 3/34", "Witold Szczur", "587 564 675");
            AddSenior(c, "Wiejska 12/3", "Eugenia Pomidor", "587 564 675");
            AddSenior(c, "Warszawska 22/44", "Genowefa Szpak", "587 564 675");
            AddSenior(c, "Warszawska 12/8", "Teresa Klawisz", "587 564 675");
            AddSenior(c, "Pi³sudskiego 4/6", "Wies³awa Lotna", "587 564 675");
            AddSenior(c, "Sienkiewicza 88/44", "Marianna Pudzianowska", "587 564 675");
            AddSenior(c, "Sienkiewicza 78/4", "Wies³awa Koks", "587 564 675");
            AddSenior(c, "Wielka 6/9", "Janina Chleb", "587 564 675");
            c.SaveChanges();
            #endregion

            #region workers
            Worker w = new Worker();
            w.WorkerId = 0;
            w.Name     = "Tomek Suchwa³ko";
            c.Workers.AddOrUpdate(w);

            w          = new Worker();
            w.WorkerId = 1;
            w.Name     = "Pawe³ Kuæ";
            c.Workers.AddOrUpdate(w);
            c.SaveChanges();
            #endregion

            #region forms
            int TomekId          = c.Workers.Where(x => x.Name.Contains("Tomek")).FirstOrDefault().WorkerId;
            int PawelId          = c.Workers.Where(x => x.Name.Contains("Pawe³")).FirstOrDefault().WorkerId;
            int formWykonanoId   = c.FormStatuses.Where(x => x.Name.Contains("Wyko")).FirstOrDefault().FormStatusId;
            int formZgloszonoId  = c.FormStatuses.Where(x => x.Name.Contains("Oczek")).FirstOrDefault().FormStatusId;
            int formRezygnacjaId = c.FormStatuses.Where(x => x.Name.Contains("Rezygn")).FirstOrDefault().FormStatusId;

            AddForm(c, 1, "klamka", new DateTime(2020, 09, 01), new DateTime(2020, 09, 03), c.Seniors.Where(x => x.Name.Contains("Konaszewski")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 2, "zamek", new DateTime(2020, 09, 01), new DateTime(2020, 09, 03), c.Seniors.Where(x => x.Name.Contains("Kokoszko")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 3, "uszczelki", new DateTime(2020, 09, 02), new DateTime(2020, 09, 04), c.Seniors.Where(x => x.Name.Contains("Ostatnia")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 4, "sedes", new DateTime(2020, 09, 02), new DateTime(2020, 09, 04), c.Seniors.Where(x => x.Name.Contains("Niemoja")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 5, "sp³uczka", new DateTime(2020, 09, 03), new DateTime(2020, 09, 05), c.Seniors.Where(x => x.Name.Contains("Szmal")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 6, "wylewka", new DateTime(2020, 09, 03), new DateTime(2020, 09, 06), c.Seniors.Where(x => x.Name.Contains("Dzwon")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 7, "cieknie kran", new DateTime(2020, 09, 04), new DateTime(2020, 09, 06), c.Seniors.Where(x => x.Name.Contains("Zachlej")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 8, "bateria ³azienka", new DateTime(2020, 09, 04), new DateTime(2020, 09, 07), c.Seniors.Where(x => x.Name.Contains("Lama")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 9, "suszarka", new DateTime(2020, 09, 05), new DateTime(2020, 09, 07), c.Seniors.Where(x => x.Name.Contains("Kubica")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 10, "mocowanie szafki", new DateTime(2020, 09, 05), new DateTime(2020, 09, 07), c.Seniors.Where(x => x.Name.Contains("Ma³ysz")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 11, "drzwi", new DateTime(2020, 09, 06), new DateTime(2020, 09, 07), c.Seniors.Where(x => x.Name.Contains("Stoch")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 12, "zamek", new DateTime(2020, 09, 06), new DateTime(2020, 09, 07), c.Seniors.Where(x => x.Name.Contains("Schumacher")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 13, "kran cieknie", new DateTime(2020, 09, 16), new DateTime(2020, 09, 18), c.Seniors.Where(x => x.Name.Contains("Aniston")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 14, "syfon", new DateTime(2020, 09, 16), new DateTime(2020, 09, 18), c.Seniors.Where(x => x.Name.Contains("Roberts")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 15, "powieszenie lustra", new DateTime(2020, 09, 17), new DateTime(2020, 09, 18), c.Seniors.Where(x => x.Name.Contains("Kotlet")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 16, "wbicie haczyka", new DateTime(2020, 09, 17), new DateTime(2020, 09, 18), c.Seniors.Where(x => x.Name.Contains("ŒledŸ")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 17, "wymiana syfonu", new DateTime(2020, 09, 18), new DateTime(2020, 09, 20), c.Seniors.Where(x => x.Name.Contains("Wódka")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 18, "bateria cieknie", new DateTime(2020, 09, 18), new DateTime(2020, 09, 20), c.Seniors.Where(x => x.Name.Contains("Kac")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 19, "okna regulacja", new DateTime(2020, 09, 19), new DateTime(2020, 09, 20), c.Seniors.Where(x => x.Name.Contains("W¹¿")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 20, "szafka siê nie zamyka", new DateTime(2020, 09, 19), new DateTime(2020, 09, 20), c.Seniors.Where(x => x.Name.Contains("Wieloryb")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 21, "uszczelka drzwi", new DateTime(2020, 09, 20), new DateTime(2020, 09, 21), c.Seniors.Where(x => x.Name.Contains("B¹czek")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 22, "suszarka ³azienkowa", new DateTime(2020, 09, 20), new DateTime(2020, 09, 29), c.Seniors.Where(x => x.Name.Contains("Smalec")).FirstOrDefault().SeniorId, PawelId, formRezygnacjaId);
            AddForm(c, 23, "baczek cieknie", new DateTime(2020, 09, 21), new DateTime(2020, 09, 23), c.Seniors.Where(x => x.Name.Contains("Morska")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 24, "kontakty naprawiæ", new DateTime(2020, 09, 21), new DateTime(2020, 09, 24), c.Seniors.Where(x => x.Name.Contains("Maruda")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 25, "¿yrandol powiesiæ", new DateTime(2020, 09, 22), new DateTime(2020, 09, 25), c.Seniors.Where(x => x.Name.Contains("Pacyfik")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 26, "zabiæ paj¹ka", new DateTime(2020, 09, 22), new DateTime(2020, 09, 23), c.Seniors.Where(x => x.Name.Contains("Czepialska")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 27, "powieszenie szafki", new DateTime(2020, 09, 23), new DateTime(2020, 09, 23), c.Seniors.Where(x => x.Name.Contains("Byk")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 28, "naprawa drzwi", new DateTime(2020, 09, 23), new DateTime(2020, 09, 25), c.Seniors.Where(x => x.Name.Contains("Wirus")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 29, "wymiana zamka", new DateTime(2020, 09, 24), new DateTime(2020, 10, 04), c.Seniors.Where(x => x.Name.Contains("Konaszewski")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 30, "naprawa zawiasów", new DateTime(2020, 09, 24), new DateTime(2020, 10, 08), c.Seniors.Where(x => x.Name.Contains("Zachlej")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 31, "sedes", new DateTime(2020, 09, 25), new DateTime(2020, 10, 20), c.Seniors.Where(x => x.Name.Contains("Roberts")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 32, "silikon wanna", new DateTime(2020, 09, 25), new DateTime(2020, 10, 21), c.Seniors.Where(x => x.Name.Contains("Wódka")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 33, "roleta", new DateTime(2020, 09, 27), new DateTime(2020, 09, 29), c.Seniors.Where(x => x.Name.Contains("Tracz")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 34, "okna regulacja", new DateTime(2020, 09, 27), new DateTime(2020, 09, 29), c.Seniors.Where(x => x.Name.Contains("Rydzyk")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 35, "okna", new DateTime(2020, 10, 01), new DateTime(2020, 10, 02), c.Seniors.Where(x => x.Name.Contains("¯y³a")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 36, "okna", new DateTime(2020, 10, 01), new DateTime(2020, 10, 03), c.Seniors.Where(x => x.Name.Contains("Wilk")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 37, "okna", new DateTime(2020, 10, 02), new DateTime(2020, 10, 03), c.Seniors.Where(x => x.Name.Contains("Kawa")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 38, "okna", new DateTime(2020, 10, 02), new DateTime(2020, 10, 05), c.Seniors.Where(x => x.Name.Contains("Tusk")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 39, "okna", new DateTime(2020, 10, 03), new DateTime(2020, 10, 05), c.Seniors.Where(x => x.Name.Contains("Szczur")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 40, "okna", new DateTime(2020, 10, 03), new DateTime(2020, 10, 07), c.Seniors.Where(x => x.Name.Contains("Pomidor")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 41, "okna", new DateTime(2020, 10, 04), new DateTime(2020, 10, 07), c.Seniors.Where(x => x.Name.Contains("Szpak")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 42, "okna", new DateTime(2020, 10, 04), new DateTime(2020, 10, 09), c.Seniors.Where(x => x.Name.Contains("Klawisz")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 43, "okna", new DateTime(2020, 10, 10), new DateTime(2020, 10, 11), c.Seniors.Where(x => x.Name.Contains("Lotna")).FirstOrDefault().SeniorId, PawelId, formWykonanoId);
            AddForm(c, 44, "okna", new DateTime(2020, 10, 10), new DateTime(2020, 10, 14), c.Seniors.Where(x => x.Name.Contains("Pudzianowska")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 45, "okna", new DateTime(2020, 10, 12), new DateTime(2020, 10, 15), c.Seniors.Where(x => x.Name.Contains("Koks")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 46, "okna", new DateTime(2020, 10, 12), new DateTime(2020, 10, 21), c.Seniors.Where(x => x.Name.Contains("Chleb")).FirstOrDefault().SeniorId, TomekId, formWykonanoId);
            AddForm(c, 47, "klamka", new DateTime(2020, 10, 13), new DateTime(2020, 11, 14), c.Seniors.Where(x => x.Name.Contains("Konaszewski")).FirstOrDefault().SeniorId, TomekId, formZgloszonoId);
            c.SaveChanges();
            #endregion

            #region Bills
            Bill b = new Bill();
            b.Name   = "Benmar 42 pu³ku";
            b.Amount = 434.21;
            b.Date   = new DateTime(2020, 09, 30);
            c.Bills.AddOrUpdate(b);

            b        = new Bill();
            b.Name   = "LM hetmañska Tomek";
            b.Amount = 104.12;
            b.Date   = new DateTime(2020, 09, 28);
            c.Bills.AddOrUpdate(b);

            b        = new Bill();
            b.Name   = "VBH klamki okna Tomek";
            b.Amount = 76.00;
            b.Date   = new DateTime(2020, 10, 16);
            c.Bills.AddOrUpdate(b);
            c.SaveChanges();
            #endregion
        }
Пример #49
0
    protected void btn_Exec_Click(object sender, EventArgs e)
    {
        #region
        try
        {
            ErrorMsgLabel.Text = "";
            ResultMsgLabel.Text = "";

            if (CheckInputValuesNotNull())
            {
                ALOModel.MaintainStoreRank BCO = new PIC.VDS2G.BSM.ALO.MaintainStoreRank(ConnectionDB);
                bool bResult = false;
                Hashtable ht = GetInputValues();

                #region 檢查是否可進行複製

                #region STEP 1:SYS_PROC_FLAG
                ht.Add("Module", "ALO");
                ht.Add("FlagName", "SET_STORERANK_YN");
                ht.Add("InProcess", "Y");

                DataTable dtTemp;
                dtTemp = BCO.CheckSysProcFlag();//檢查是否可進行複製

                if (dtTemp != null && dtTemp.Rows.Count > 0)
                {
                    #region
                    if (dtTemp.Rows[0]["errStoreRank"].ToString().Trim() != "")
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ClientScript", string.Format("alert('{0}');", dtTemp.Rows[0]["errStoreRank"].ToString().Trim().Replace("請稍後再計算", "請稍後再複製")), true);
                        return;
                    }

                    if (dtTemp.Rows[0]["errDisRec"].ToString().Trim() != "")
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ClientScript", string.Format("alert('{0}');", dtTemp.Rows[0]["errDisRec"].ToString().Trim().Replace("請稍後再計算", "請稍後再複製")), true);
                        return;
                    }

                    if (dtTemp.Rows[0]["errMultiDisRec"].ToString().Trim() != "")
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ClientScript", string.Format("alert('{0}');", dtTemp.Rows[0]["errMultiDisRec"].ToString().Trim().Replace("請稍後再計算", "請稍後再複製")), true);
                        return;
                    }
                    #endregion
                }
                #endregion

                #region STEP 2:VDS_ALO_STORERANK_MAIN & VDS_ALO_STORERANK_DETL

                bool bTMP = BCO.CheckCanCopy(ht);
                if (!bTMP)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ClientScript", string.Format("alert('{0}');", "查無資料可複製"), true);
                    return;
                }

                #endregion

                #endregion

                #region 進行複製

                try
                {
                    BCO.SetSYS_PROC_FLAG(ht, null);//設定複製執行中

                    if (rbtn_CopyStore.Checked)
                    {
                        bResult = BCO.CopyStoreRankByStore(ht, null);
                    }
                    else if (rbtn_CopyPattern.Checked)
                    {
                        bResult = BCO.CopyStoreRankByPattern(ht, null);
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    ht["InProcess"] = null;
                    BCO.SetSYS_PROC_FLAG(ht, null);//複製完畢
                }

                if (bResult)
                {
                    ResultMsgLabel.Text = "複製成功";
                }
                else
                {
                    ResultMsgLabel.Text = "複製失敗";
                }
                #endregion
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            fmStatus = FormStatus.fmBrowse;
            UpdatePanel1.Update();
        }
        #endregion
    }
Пример #50
0
 private void tambahBtn_Click(object sender, EventArgs e)
 {
     FrmStatus = FormStatus.NewRecord;
     invoiceItemBindingSource.AddNew();
 }
Пример #51
0
 public BaseForm SetFormStatus(FormStatus formStatus)
 {
     _formStatus = formStatus;
     return(this);
 }
Пример #52
0
 private void batalBtn_Click(object sender, EventArgs e)
 {
     FrmStatus = FormStatus.Ready;
     invoiceItemBindingSource.Remove(invoiceItemBindingSource.Current);
 }
Пример #53
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        int         form_Id        = Convert.ToInt32(this.ViewState["form_Id"]);
        HiddenField hidden_form_no = e.Row.FindControl("hidden_form_no") as HiddenField;

        if (hidden_form_no != null)
        {
            string form_status = DataBinder.Eval(e.Row.DataItem, "FormStatus").ToString();
            int    form_no     = int.Parse(hidden_form_no.Value);


            FormInfo form_obj = FormBiz.GetForm(form_Id);
            if (form_obj == null)
            {
                throw new ApplicationException(string.Format("form kind ({0}) does not exists.", form_Id));
            }

            HyperLink hyperlink_view = e.Row.FindControl("hyperlink_view") as HyperLink;
            if (form_status == FormStatus.NC || form_status == FormStatus.DE)
            {
                hyperlink_view.Visible = false;
            }
            else
            {
                hyperlink_view.Visible = true;

                string view_url = form_obj.ViewUrl;

                if (string.IsNullOrEmpty(view_url))
                {
                    throw new ApplicationException(string.Format("form kind ({0}), view_url not set.", form_Id));
                }
                if (view_url.Contains("?"))
                {
                    view_url = string.Format("{0}&form_no={1}", view_url, form_no);
                }
                else
                {
                    view_url = string.Format("{0}?form_no={1}", view_url, form_no);
                }

                hyperlink_view.NavigateUrl = view_url;
            }


            ImageButton button_modify = e.Row.FindControl("button_modify") as ImageButton;
            if ((form_status == FormStatus.RC) ||
                (form_status == FormStatus.NC) ||
                (form_status == FormStatus.RJ))
            {
                button_modify.Visible = true;

                //string modify_url = form_obj.ModifyUrl;
                //if (string.IsNullOrEmpty(modify_url))
                //{
                //    throw new ApplicationException(string.Format("form kind ({0}), modify_url not set.", form_Id));
                //}
                //if (modify_url.Contains("?"))
                //{
                //    modify_url = string.Format("{0}&form_no={1}", modify_url, form_no);
                //}
                //else
                //{
                //    modify_url = string.Format("{0}&form_no={1}", modify_url, form_no);
                //}
                //hyperlink_modify.NavigateUrl = modify_url;
            }
            else
            {
                // hyperlink_modify.Enabled = false;
                button_modify.Visible = false;
            }

            ImageButton button_withdraw = e.Row.FindControl("button_withdraw") as ImageButton;
            if (form_status == FormStatus.UA)
            {
                // button_withdraw.Enabled = true;
                button_withdraw.Visible = true;
            }
            else
            {
                // button_withdraw.Enabled = false;
                button_withdraw.Visible = false;
            }

            ImageButton button_urgent = e.Row.FindControl("button_urgent") as ImageButton;
            if (form_status == FormStatus.UA)
            {
                button_urgent.Visible = true;
            }
            else
            {
                button_urgent.Visible = false;
            }

            ImageButton button__approvelist = e.Row.FindControl("button_approve_list") as ImageButton;
            string      script = string.Format("showApproveList({0},{1})",
                                               DataBinder.Eval(e.Row.DataItem, "FormId"),
                                               DataBinder.Eval(e.Row.DataItem, "FormNo"));

            button__approvelist.Attributes.Add("onclick", script);

            Label label_form_id = e.Row.FindControl("label_form_id") as Label;
            if (label_form_id != null)
            {
                label_form_id.Text = FormBiz.GetForm(form_Id).FormName;
            }
        }


        Label label_apply_user = e.Row.FindControl("label_apply_user") as Label;

        if (label_apply_user != null)
        {
            string user_id = DataBinder.Eval(e.Row.DataItem, "Applyer").ToString();
            label_apply_user.Text = UserBiz.GetUser(user_id).LoginName;
        }

        Label label_approve_status = e.Row.FindControl("label_approve_status") as Label;

        if (label_approve_status != null)
        {
            string status = DataBinder.Eval(e.Row.DataItem, "FormStatus").ToString();
            label_approve_status.Text = FormStatus.GetStatusFullName(status);
        }
    }
Пример #54
0
 public static String GetStatusFormTitle(String title, FormStatus status)
 {
     return PMSupport.UpdateTitle(title, status);
 }
 private void btnOK_Click(object sender, EventArgs e)
 {
     SelectedOperation = dgvOperations.CurrentRow.DataBoundItem as Operation;
     FormStatus        = WTFClassLibrary.FormStatus.Succeeded;
     this.Dispose();
 }
Пример #56
0
 public static void SetStatusForm(Form frm, FormStatus status)
 {
     PMSupport.SetTitle(frm, status);
 }
 private void dgvOperations_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     SelectedOperation = dgvOperations.CurrentRow.DataBoundItem as Operation;
     FormStatus        = WTFClassLibrary.FormStatus.Succeeded;
     this.Dispose();
 }
Пример #58
0
    protected void btn_Exec_Click(object sender, EventArgs e)
    {
        try
        {
            if (CheckInputValuesNotNull())
            {
                if (SLP_SKU1.Text.Trim() == SLP_SKU2.Text.Trim())
                {
                    ResultMsgLabel.Text = "品號不可相同";
                    return;
                }

                ALOModel.MaintainStoreOrderItem BCO = new PIC.VDS2G.BSM.ALO.MaintainStoreOrderItem(ConnectionDB);
                bool bResult = BCO.CopyToNewItem(GetInputValues(), null);
                if (bResult)
                {
                    ResultMsgLabel.Text = "複製成功";
                }
                else
                {
                    ResultMsgLabel.Text = "複製失敗";
                }
            }
            else
            {
                ResultMsgLabel.Text = "欄位不可空白";
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            fmStatus = FormStatus.fmBrowse;
        }


    }
Пример #59
0
        private void Stage(IList<GitItemStatus> gitItemStatusses)
        {
            EnableStageButtons(false);
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                Unstaged.StoreNextIndexToSelect();
                toolStripProgressBar1.Visible = true;
                toolStripProgressBar1.Maximum = gitItemStatusses.Count() * 2;
                toolStripProgressBar1.Value = 0;

                var files = new List<GitItemStatus>();

                foreach (var gitItemStatus in gitItemStatusses)
                {
                    toolStripProgressBar1.Value = Math.Min(toolStripProgressBar1.Maximum - 1, toolStripProgressBar1.Value + 1);
                    if (gitItemStatus.Name.EndsWith("/"))
                        gitItemStatus.Name = gitItemStatus.Name.TrimEnd('/');
                    files.Add(gitItemStatus);
                }

                bool wereErrors = false;
                if (Settings.ShowErrorsWhenStagingFiles)
                {
                    FormStatus.ProcessStart processStart =
                        form =>
                        {
                            form.AddMessageLine(string.Format(_stageFiles.Text,
                                                         files.Count));
                            var output = Module.StageFiles(files, out wereErrors);
                            form.AddMessageLine(output);
                            form.Done(string.IsNullOrEmpty(output));
                        };
                    using (var process = new FormStatus(processStart, null) { Text = _stageDetails.Text })
                        process.ShowDialogOnError(this);
                }
                else
                {
                    Module.StageFiles(files, out wereErrors);
                }
                if (wereErrors)
                    RescanChanges();
                else
                {
                    LockedFilesSelectionChanging(() =>
                        {
                            InitializedStaged();
                            var unStagedFiles = Unstaged.GitItemStatuses.ToList();
                            Unstaged.GitItemStatuses = null;
                            var names = new HashSet<string>();
                            foreach (var item in files)
                            {
                                names.Add(item.Name);
                                names.Add(item.OldName);
                            }
                            var unstagedItems = new HashSet<GitItemStatus>();
                            foreach (var item in unStagedFiles)
                            {
                                if (names.Contains(item.Name))
                                    unstagedItems.Add(item);
                            }
                            unStagedFiles.RemoveAll(item => !item.IsSubmodule && unstagedItems.Contains(item));
                            unStagedFiles.RemoveAll(item => item.IsSubmodule && item.SubmoduleStatus.IsCompleted &&
                                !item.SubmoduleStatus.Result.IsDirty && unstagedItems.Contains(item));
                            foreach (var item in unstagedItems.Where(item => item.IsSubmodule &&
                                item.SubmoduleStatus.IsCompleted && item.SubmoduleStatus.Result.IsDirty))
                            {
                                item.SubmoduleStatus.Result.Status = SubmoduleStatus.Unknown;
                            }
                            Unstaged.GitItemStatuses = unStagedFiles;
                        });
                    Unstaged.SelectStoredNextIndex();
                }

                toolStripProgressBar1.Value = toolStripProgressBar1.Maximum;

                toolStripProgressBar1.Visible = false;
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
            }
            EnableStageButtons(true);

            Commit.Enabled = true;
            Amend.Enabled = true;
            AcceptButton = Commit;
            Cursor.Current = Cursors.Default;

            if (Settings.RevisionGraphShowWorkingDirChanges)
                UICommands.RepoChangedNotifier.Notify();
        }
Пример #60
0
        private void FinishRunningProcessCallback(IAsyncResult ar)
        {
            if (this.InvokeRequired)
            {
                // We're not in the main thread and cannot make updates to
                // the UI. Call the delegate on the UI thread so we can
                // update controls.
                IAsyncResult arx = this.BeginInvoke (new AsyncCallback (FinishRunningProcessCallback), new object[] {ar});
                this.EndInvoke (arx);

                // The main thread has been notified. Now we must end this
                // function.
                return;
            }

            this.selected_session.EndResultsGathering ();

            this._process_status = FormStatus.no_process_running;

            this.ResizeWebView ();
            this.UpdateSessionTreeView ();

            // Select the results file in the session browser
            this.SelectAndDisplayGeneratedResults ();

            // Enable all relevant controls on the Project form.
            this.SessionBrowser.Enabled = true;
            this.ButtonGeneralInformation.Enabled = true;
            this.ButtonActivityLogging.Enabled = true;
            this.ButtonDetailedValidation.Enabled = true;

            // Switch to the detailed validation results.
            this.ButtonDetailedValidation.Checked = true;

            this.WebDescriptionView.Visible = true;

            this.PanelSOPClasses.Visible = false;
            this.VScrollBarSessionInfo.Visible = false;
            this.PanelSessionProperties.Visible = false;
            this.RichTextBoxInfo.Visible = false;
            this.RichTextBoxScript.Visible = false;
            this.RichTextBoxActivityLogging.Visible = false;

            if (this.ParentForm != null)
            {
                // Update the mainform controls (menu, toolbar, title)
                ((MainForm)this.ParentForm).UpdateUIControls ();
            }
        }