Exemple #1
0
    private string ProcessConfirmFromBridge(string strStAcceptDate, string strDisNoForAry, string strCtrlPending, Int32 iProcessingAryIndex)
    {
        #region
        bool bResult = false, bResultCheck = false;
        string strCallbackResult = "";
        string strResult = "", strErrMsg = "", strErrMsgCheck = "";
        string strPrefixed = "POP_DisApproveError";
        string strDisNo = "", strNextDisNo = "";
        string strDIS_QTY = "";
        string[] strAryDisAry = strDisNoForAry.Split(";".ToCharArray());
        string[] strAryCtrlPending = strCtrlPending.Split(";".ToCharArray());

        try
        {
            fmStatus = FormStatus.fmProcess;

            ALOModel.MaintainDisRecord BCO = new ALOModel.MaintainDisRecord(ConnectionDB);
            if (iProcessingAryIndex < strAryDisAry.Length)
            {

                strDisNo = strAryDisAry[iProcessingAryIndex];

                ArrayList ParameterList = new ArrayList();//20091113

                //---------------------------------------------------------------------
                //2010/02/09 added:確認前檢核
                ALOModel.MaintainDisCRMRecord BCO3 = new ALOModel.MaintainDisCRMRecord(ConnectionDB);
                ParameterList.Clear();
                ParameterList.Add(strStAcceptDate);
                ParameterList.Add(strDisNo);
                try
                {
                    bResultCheck = BCO3.Pick_Control_Check(ParameterList, out strErrMsgCheck);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                //---------------------------------------------------------------------


                ParameterList.Clear();
                ParameterList.Add(strStAcceptDate);
                ParameterList.Add(strDisNo);
                ParameterList.Add("VDS_ALO_DIS_STORE");
                ParameterList.Add(strAryCtrlPending[5]);

                try
                {
                    bResult = BCO.ProcessConfirm(ParameterList, out strResult, out strErrMsg, null);
                }
                catch (Exception ex)
                {
                    throw ex;
                }


                if (!bResult)
                {
                    Session[string.Format("{0}_DISNO_{1}", strPrefixed, strAryCtrlPending[0])] += string.Format("{0},", strDisNo);
                    Session[string.Format("{0}_OPTYPE_{1}", strPrefixed, strAryCtrlPending[0])] = "1";
                    Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strAryCtrlPending[0])] += string.Format("配本序號:{0},{1}{2}{3};\r\n", strDisNo, strErrMsgCheck, bResultCheck ? "" : ",", strErrMsg);
                }
                else
                {
                    if (!bResultCheck)
                    {
                        Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strAryCtrlPending[0])] += string.Format("配本序號:{0},{1};\r\n", strDisNo, strErrMsgCheck);
                    }
                }


                ALOModel.ProcessMultiDisRecords BCO2 = new ALOModel.ProcessMultiDisRecords(ConnectionDB);
                DataTable dtTemp = BCO2.QueryDisItemForALO20(GetQueryParams(strStAcceptDate, strDisNo, bResult));
                if (dtTemp != null && dtTemp.Rows.Count > 0)
                    strDIS_QTY = dtTemp.Rows[0]["DIS_QTY"].ToString().Trim();

                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-
                //7:ST_ACCEPT_DATE ClientID-
                //8:ResultMsgLabel ClientID-
                //9:ErrMsgLabel ClientID-
                //10:將再開啟之控制項字串陣列
                //11:DIS_QTY
                string strCtrlIDToUnLock = string.Format("{0}", strAryCtrlPending[1]);

                strCallbackResult = string.Format("{0}-{1}-{2}-{3}-{4}-{5}-{6}-{7}-{8}-{9}-{10}-{11}",
                    strDisNoForAry,
                    iProcessingAryIndex,
                    bResult ? "OK" : "NG",
                    Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strAryCtrlPending[0])].ToString(),//strErrMsg,
                    strDisNo,
                    strNextDisNo,
                    Session[string.Format("{0}_DISNO_{1}", strPrefixed, strAryCtrlPending[0])] == null ? "0" : "1",
                    strAryCtrlPending[2],
                    strAryCtrlPending[3],
                    strAryCtrlPending[4],
                    strCtrlIDToUnLock,
                    strDIS_QTY
                    );
            }

        }
        catch (Exception ex)
        {
            throw ex;
        }

        return strCallbackResult;
        #endregion
    }
Exemple #2
0
    private void QueryData()
    {
        #region
        try
        {
            string strPrefixed = "POP_DisApproveError";
            Session[string.Format("{0}_DISNO_{1}", strPrefixed, PageTimeStamp.Value)] = null;
            string SessionIDName = string.Format("{0}_{1}", PAGE_DT_01, PageTimeStamp.Value);
            ALOModel.ProcessMultiDisRecords BCO = new ALOModel.ProcessMultiDisRecords(ConnectionDB);
            DataTable dt = null;
            if (Session[SessionIDName] == null)
            {
                dt = BCO.QueryDisItemForALO20(GetQueryParams());
                Session[SessionIDName] = dt;
            }
            else
            {
                dt = (DataTable)Session[SessionIDName];
            }

            #region Virtual Data
            //DataTable dt = new DataTable();
            //DataRow dr; 
            //dt.Columns.Add("DIS_NO");
            //dt.Columns.Add("ROOT_NAME");
            //dt.Columns.Add("PMA_NAME");
            //dt.Columns.Add("PATTERN_NAME");
            //dt.Columns.Add("ITEM");
            //dt.Columns.Add("ITEM_NAME");
            //dt.Columns.Add("PERIOD");
            //dt.Columns.Add("ACCEPT_QTY");
            //dt.Columns.Add("DIS_PRE_QTY");
            //dt.Columns.Add("DIS_QTY");
            //dt.Columns.Add("ST_ACCEPT_DATE");
            //dt.Columns.Add("APPROVE_DATE");
            //dt.Columns.Add("N_ST_ACCEPT_STATUS");
            //dt.Columns.Add("N_CHECK");
            //dt.Columns.Add("N_Deal_Result");

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "AAA";
            //dr["ITEM"] = "100978";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = GetOutStatus();
            //dr["N_CHECK"] = GetCheckStatus();
            //dt.Rows.Add(dr);

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "AAA";
            //dr["ITEM"] = "100111";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = GetOutStatus();
            //dr["N_CHECK"] = GetCheckStatus();
            //dt.Rows.Add(dr);

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "AAA";
            //dr["ITEM"] = "100222";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = GetOutStatus();
            //dr["N_CHECK"] = GetCheckStatus();
            //dt.Rows.Add(dr);

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "AAA";
            //dr["ITEM"] = "100333";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = GetOutStatus();
            //dr["N_CHECK"] = GetCheckStatus();
            //dt.Rows.Add(dr);

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "BBB";
            //dr["ITEM"] = "100978";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = GetOutStatus();
            //dr["N_CHECK"] = GetCheckStatus();
            //dt.Rows.Add(dr);

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "CCC";
            //dr["ITEM"] = "100111";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = "0";
            //dr["N_CHECK"] = "1";
            //dt.Rows.Add(dr);

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "CCC";
            //dr["ITEM"] = "100222";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = GetOutStatus();
            //dr["N_CHECK"] = GetCheckStatus();
            //dt.Rows.Add(dr);

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "CCC";
            //dr["ITEM"] = "100333";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = GetOutStatus();
            //dr["N_CHECK"] = GetCheckStatus();
            //dt.Rows.Add(dr);

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "DDD";
            //dr["ITEM"] = "100555";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = GetOutStatus();
            //dr["N_CHECK"] = GetCheckStatus();
            //dt.Rows.Add(dr);

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "EEE";
            //dr["ITEM"] = "100666";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = GetOutStatus();
            //dr["N_CHECK"] = GetCheckStatus();
            //dt.Rows.Add(dr);

            //dr = dt.NewRow();
            //dr["DIS_NO"] = "FFF";
            //dr["ITEM"] = "100777";
            //dr["ST_ACCEPT_DATE"] = SLP_SLPDate1.Text;
            //dr["APPROVE_DATE"] = DateTime.Now.AddDays(-15).ToString("yyyy/MM/dd");
            //dr["N_ST_ACCEPT_STATUS"] = GetOutStatus();
            //dr["N_CHECK"] = GetCheckStatus();
            //dt.Rows.Add(dr);


            #endregion


            if (dt != null && dt.Rows.Count > 0)
            {
                gv_Result.PageSize = iCurrentGvPageSize;
                gv_Result.PageIndex = iCurrentGvPageIndex;

                DataView dv = dt.DefaultView;
                dv.Sort = "DIS_NO";

                gv_Result.DataSource = dv;
                gv_Result.DataBind();

                //if (dt.Rows.Count >= 30)
                //    Panel_Result.Height = 500;
                //else if (dt.Rows.Count >= 10)
                //    Panel_Result.Height = 300;
                //else
                //    Panel_Result.Height = 200;

                LabelQueryRecordCount.Text = string.Format(" {0} Rows ", dt.Rows.Count.ToString());
                SwitchControlsAfterQuery(true);
            }
            else
            {
                gv_Result.DataBind();
                //Panel_Result.Height = 0;
                ResultMsgLabel.Text = "查無資料";
                SwitchControlsAfterQuery(false);
            }
        }
        catch (Exception ex)
        {
            gv_Result.DataBind();
            ErrorMsgLabel.Text = ex.Message;
        }

        #endregion
    }
Exemple #3
0
    private bool UpdateDisItemAndStore(StoreCheckType sct)
    {
        #region
        bool bResult = false;
        try
        {
            DataTable dt = null;
            DataTable dt2 = null;
            Int32 iNEW_DIS_QTY = 0;

            if (sct == StoreCheckType.OpenAndClose)
            {
                dt = dt_OpenCloseStore;
                dt2 = dt.Clone();
                #region

                for (Int32 i = 0; i <= gv_ResultOpenCloseStore.Rows.Count - 1; i++)
                {
                    Label lbl_CODE = (Label)gv_ResultOpenCloseStore.Rows[i].FindControl("lbl_CODE");
                    RadioButton rbtn_DIS_QTY = (RadioButton)gv_ResultOpenCloseStore.Rows[i].FindControl("rbtn_OpenCloseStore_DIS_QTY");
                    RadioButton rbtn_NEW_DIS_QTY = (RadioButton)gv_ResultOpenCloseStore.Rows[i].FindControl("rbtn_OpenCloseStore_NEW_DIS_QTY");
                    TextBox txt_NEW_DIS_QTY = (TextBox)gv_ResultOpenCloseStore.Rows[i].FindControl("txt_OpenCloseStore_NEW_DIS_QTY");

                    //DataTable dtTmp = dt_OpenCloseStore.Copy();

                    //if (rbtn_NEW_DIS_QTY.Checked)
                    //{
                    //    DataRow drTmp = dtTmp.Select(string.Format("CODE = '{0}'", lbl_CODE.Text.Trim()))[0];
                    //    Int32.TryParse(txt_NEW_DIS_QTY.Text.Trim(), out iNEW_DIS_QTY);
                    //    if (iNEW_DIS_QTY.ToString() != drTmp["N_NEW_DIS_QTY"].ToString().Trim())
                    //    {
                    //        drTmp["N_NEW_DIS_QTY"] = iNEW_DIS_QTY;
                    //        drTmp["UPDATEDATE"] = DateTime.Now;
                    //        drTmp["UPDATEUID"] = Session["UID"].ToString();
                    //    }
                    //    dt2.ImportRow(drTmp);

                    //}

                    if (dt_OpenCloseStore != null && dt_OpenCloseStore.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt_OpenCloseStore.Rows)
                        {
                            if (lbl_CODE.Text.Trim() == dr["CODE"].ToString().Trim())
                            {

                                #region old source
                                //if (rbtn_DIS_QTY.Checked) //原配量
                                //    Int32.TryParse(rbtn_DIS_QTY.Text.Trim(), out iNEW_DIS_QTY);
                                //else if (rbtn_NEW_DIS_QTY.Checked) //新配量
                                //    Int32.TryParse(txt_NEW_DIS_QTY.Text.Trim(), out iNEW_DIS_QTY);


                                //if (iNEW_DIS_QTY.ToString() != dr["N_NEW_DIS_QTY"].ToString().Trim())
                                //{
                                //    dr["N_NEW_DIS_QTY"] = iNEW_DIS_QTY;
                                //    dr["UPDATEDATE"] = DateTime.Now;
                                //    dr["UPDATEUID"] = Session["UID"].ToString();
                                //}
                                #endregion

                                if (rbtn_NEW_DIS_QTY.Checked) //新配量
                                {
                                    Int32.TryParse(txt_NEW_DIS_QTY.Text.Trim(), out iNEW_DIS_QTY);
                                    if (iNEW_DIS_QTY.ToString() != dr["N_NEW_DIS_QTY"].ToString().Trim())
                                    {
                                        dr["N_NEW_DIS_QTY"] = iNEW_DIS_QTY;
                                        dr["UPDATEDATE"] = DateTime.Now;
                                        dr["UPDATEUID"] = Session["UID"].ToString();
                                    }
                                    // 將異動資料丟到dt2
                                    dt2.ImportRow(dr);

                                }
                            }
                        }
                    }
                }
                #endregion
                if (dt2 != null && dt2.Rows.Count > 0)
                {
                    ALOModel.ProcessMultiDisRecords BCO = new ALOModel.ProcessMultiDisRecords(ConnectionDB);
                    bResult = BCO.UpdateDisItemAndStore(dt2, null);
                }
                else if (dt2.Rows.Count == 0)
                {
                    bResult = true;
                }

            }
            else if (sct == StoreCheckType.VenderAssigend)
            {
                dt = dt_VenderAssignedStore;

                #region

                for (Int32 i = 0; i <= gv_ResultVenderAssigendStore.Rows.Count - 1; i++)
                {
                    Label lbl_CODE = (Label)gv_ResultVenderAssigendStore.Rows[i].FindControl("lbl_CODE");
                    RadioButton rbtn_DIS_QTY = (RadioButton)gv_ResultVenderAssigendStore.Rows[i].FindControl("rbtn_VenderAssigendStore_DIS_QTY_D");
                    RadioButton rbtn_ORDER_QTY_D = (RadioButton)gv_ResultVenderAssigendStore.Rows[i].FindControl("rbtn_VenderAssigendStore_ORDER_QTY_D");
                    RadioButton rbtn_NEW_DIS_QTY = (RadioButton)gv_ResultVenderAssigendStore.Rows[i].FindControl("rbtn_VenderAssigendStore_NEW_DIS_QTY_D");
                    TextBox txt_NEW_DIS_QTY = (TextBox)gv_ResultVenderAssigendStore.Rows[i].FindControl("txt_VenderAssigendStore_NEW_DIS_QTY");

                    if (dt_VenderAssignedStore != null && dt_VenderAssignedStore.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt_VenderAssignedStore.Rows)
                        {
                            if (lbl_CODE.Text.Trim() == dr["CODE"].ToString().Trim())
                            {

                                if (rbtn_DIS_QTY.Checked)
                                    Int32.TryParse(rbtn_DIS_QTY.Text.Trim(), out iNEW_DIS_QTY);
                                else if (rbtn_ORDER_QTY_D.Checked)
                                    Int32.TryParse(rbtn_ORDER_QTY_D.Text.Trim(), out iNEW_DIS_QTY);
                                else if (rbtn_NEW_DIS_QTY.Checked)
                                    Int32.TryParse(txt_NEW_DIS_QTY.Text.Trim(), out iNEW_DIS_QTY);

                                if (iNEW_DIS_QTY.ToString() != dr["N_NEW_DIS_QTY"].ToString().Trim())
                                {
                                    dr["N_NEW_DIS_QTY"] = iNEW_DIS_QTY;
                                    dr["UPDATEDATE"] = DateTime.Now;
                                    dr["UPDATEUID"] = Session["UID"].ToString();
                                }
                            }
                        }
                    }
                }
                #endregion
                if (dt != null && dt.Rows.Count > 0)
                {
                    ALOModel.ProcessMultiDisRecords BCO = new ALOModel.ProcessMultiDisRecords(ConnectionDB);
                    bResult = BCO.UpdateDisItemAndStore(dt, null);
                }
                else if (dt.Rows.Count == 0)
                {
                    bResult = true;
                }
            }


        }
        catch (Exception ex)
        {
            throw ex;
        }

        return bResult;
        #endregion
    }
Exemple #4
0
    /// <summary>
    /// 檢核後之變更量異動
    /// </summary>
    private void ReplaceDisQty()
    {
        #region
        string SessionIDName_PARAMS = string.Format("{0}_PARAMS_{1}", PAGE_DT_01, PageTimeStamp.Value);
        ArrayList ParameterList = (ArrayList)Session[SessionIDName_PARAMS];

        string SessionIDName = string.Format("{0}_{1}", PAGE_DT_01, PageTimeStamp.Value);
        DataTable dtOriginal = (DataTable)Session[SessionIDName];

        ALOModel.ProcessMultiDisRecords BCO = new ALOModel.ProcessMultiDisRecords(ConnectionDB);
        DataTable dtNew = null;
        try
        {
            dtNew = BCO.QueryDisItemForALO20(ParameterList);
            if (dtOriginal != null && dtNew != null && dtNew.Rows.Count > 0)
            {
                for (Int32 i = 0; i <= dtOriginal.Rows.Count - 1; i++)
                {
                    for (Int32 j = 0; j <= dtNew.Rows.Count - 1; j++)
                    {
                        if (dtOriginal.Rows[i]["DIS_NO"].ToString().Trim() == dtNew.Rows[j]["DIS_NO"].ToString().Trim() &&
                            dtOriginal.Rows[i]["ITEM"].ToString().Trim() == dtNew.Rows[j]["ITEM"].ToString().Trim() &&
                            dtOriginal.Rows[i]["PERIOD"].ToString().Trim() == dtNew.Rows[j]["PERIOD"].ToString().Trim()
                            )
                        {
                            dtOriginal.Rows[i]["DIS_QTY"] = dtNew.Rows[j]["DIS_QTY"].ToString().Trim();
                            break;
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
Exemple #5
0
    /// <summary>
    /// 根據勾選項目進行檢核
    /// </summary>
    /// <param name="sct"></param>
    private void QueryData(StoreCheckType sct)
    {
        #region
        try
        {
            ALOModel.ProcessMultiDisRecords BCO = new ALOModel.ProcessMultiDisRecords(ConnectionDB);
            DataTable dt = null;
            ArrayList ParameterList = new ArrayList();
            string strPrefixed = "POP_StoreCheck";
            if (sct == StoreCheckType.OpenAndClose)
            {
                #region  開關店
                ParameterList.Clear();
                ParameterList.Add(s_DIS_NO);
                ParameterList.Add(SLP_SLPDate1.Text);
                ParameterList.Add(i_DIS_NO_Count);
                ParameterList.Add(Session["UID"].ToString());
                ParameterList.Add(chk_OpenCloseStore.Checked ? "1" : "0");//2010/02/11

                //gv_ResultOpenCloseStore.DataBind();
                //gv_ResultVenderAssigendStore.DataBind();

                #region old
                //if (sct == StoreCheckType.OpenAndClose)
                //{
                //    #region
                //    dt = BCO.QueryOpenAndCloseStore(ParameterList);

                //    dt_OpenCloseStore = dt;

                //    if (dt != null && dt.Rows.Count > 0)
                //    {
                //        if (dt.Rows.Count >= 100)
                //        {
                //            Session[string.Format("{0}_{1}", strPrefixed, PageTimeStamp.Value)] = dt;
                //            ScriptManager.RegisterStartupScript(this, this.GetType(), "storecheck", "POP_StoreCheck();", true);
                //            ResultMsgLabel.Text = string.Format("開關店檢核資料結果超過上限筆數:{0},請先進行錯誤排除。", iErrorCountLimit);
                //            bErrorCountOverLimit = true;
                //            return;
                //            //Panel_OpenCloseStore.Height = 300;
                //        }
                //        else
                //        {
                //            gv_ResultOpenCloseStore.DataSource = dt;
                //            gv_ResultOpenCloseStore.DataBind();
                //            btn_SaveOpenCloseStore.Enabled = true;
                //            hidden_Executed_OpenCloseStore.Value = "0";
                //        }
                //    }
                //    else
                //    {
                //        gv_ResultOpenCloseStore.DataBind();
                //        //Panel_OpenCloseStore.Height = 0;
                //        ResultMsgLabel.Text += " 查無開關店檢核資料 ";

                //        btn_SaveOpenCloseStore.Enabled = false;
                //        hidden_Executed_OpenCloseStore.Value = "1";

                //    }

                //    Panel_OpenCloseStoreAll.Visible = true;

                //    #endregion
                //}
                #endregion

                #region new
                dt = BCO.QueryOpenAndCloseStore(ParameterList);

                dt_OpenCloseStore = dt;

                if (dt != null && dt.Rows.Count > 0)
                {
                    if (dt.Rows.Count >= 100)
                    {
                        Session[string.Format("{0}_{1}", strPrefixed, PageTimeStamp.Value)] = dt;
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "storecheck", "POP_StoreCheck();", true);
                        ResultMsgLabel.Text = string.Format("開關店檢核資料結果超過上限筆數:{0},請先進行錯誤排除。", iErrorCountLimit);
                        bErrorCountOverLimit = true;
                        return;
                        //Panel_OpenCloseStore.Height = 300;
                    }
                    else
                    {
                        gv_ResultOpenCloseStore.DataSource = dt;
                        gv_ResultOpenCloseStore.DataBind();
                        btn_SaveOpenCloseStore.Enabled = true;
                        hidden_Executed_OpenCloseStore.Value = "0";
                    }
                }
                else
                {
                    gv_ResultOpenCloseStore.DataBind();
                    //Panel_OpenCloseStore.Height = 0;
                    ResultMsgLabel.Text += " 查無開關店檢核資料 ";

                    btn_SaveOpenCloseStore.Enabled = false;
                    hidden_Executed_OpenCloseStore.Value = "1";

                }

                Panel_OpenCloseStoreAll.Visible = true;
                #endregion
                #endregion
            }

            else if (sct == StoreCheckType.VenderAssigend)
            {
                #region 指定店

                ParameterList.Clear();
                ParameterList.Add(s_DIS_NO);
                ParameterList.Add(SLP_SLPDate1.Text);
                ParameterList.Add(i_DIS_NO_Count);
                ParameterList.Add(Session["UID"].ToString());

                dt = BCO.QueryVenderAssigendStore(ParameterList);

                dt_VenderAssignedStore = dt;

                if (dt != null && dt.Rows.Count > 0)
                {
                    if (dt.Rows.Count >= 100)
                    {
                        Session[string.Format("{0}_{1}", strPrefixed, PageTimeStamp.Value)] = dt;
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "storecheck", "POP_StoreCheck();", true);
                        ResultMsgLabel.Text = string.Format("指定店檢核資料結果超過上限筆數:{0},請先減少配本序號檢核數量。", iErrorCountLimit);
                        bErrorCountOverLimit = true;
                        return;
                        //Panel_VenderAssignedStore.Height = 300;
                    }
                    else
                    {
                        gv_ResultVenderAssigendStore.DataSource = dt;
                        gv_ResultVenderAssigendStore.DataBind();
                        btn_SaveVenderAssigendStore.Enabled = true;
                        hidden_Executed_VenderAssignedStore.Value = "0";
                    }
                }
                else
                {
                    gv_ResultVenderAssigendStore.DataBind();
                    //Panel_VenderAssignedStore.Height = 0;
                    ResultMsgLabel.Text += " 查無指定店檢核資料 ";

                    btn_SaveVenderAssigendStore.Enabled = false;
                    hidden_Executed_VenderAssignedStore.Value = "1";

                }

                Panel_VenderAssignedStoreAll.Visible = true;

                #endregion
            }

        }
        catch (Exception ex)
        {
            throw ex;
        }


        #endregion
    }