Пример #1
0
    private void LoadPrint()
    {
        try
        {
            TextBoxPagesize.Text = (TextBoxPagesize.Text == "") ? "20" : (int.Parse(TextBoxPagesize.Text) < 0) ? "20" : TextBoxPagesize.Text;

            ViewState["ddlS"] = this.ddlS.SelectedIndex > 0 ? this.ddlS.SelectedIndex : 0;
            ViewState["ddlE"] = this.ddlE.SelectedIndex > 0 ? this.ddlE.SelectedIndex : 0;
            ViewState["CodeFile"] = this.SLP_CodeFile1.DropDownListControl.SelectedIndex > 0 ? this.SLP_CodeFile1.DropDownListControl.SelectedIndex : 0;

            string SL_S = string.Empty;
            string SL_E = string.Empty;

            if (ddlS.SelectedIndex == 0)
            {
                SL_S = ddlS.Items[1].Value.ToString();
            }
            else
            {
                SL_S = ddlS.SelectedValue;
            }

            if (ddlE.SelectedIndex == 0)
            {
                SL_E = ddlE.Items[ddlE.Items.Count - 1].Value.ToString();
            }
            else
            {
                SL_E = ddlE.SelectedValue;
            }
            IVMModel.MaintainStockTake BCO = new PIC.VDS2G.VSM.IVM.MaintainStockTake(ConntionDB);
            ParameterList.Clear();
            ParameterList.Add(this.SLP_CodeFile1.Text + SL_S);
            ParameterList.Add(this.SLP_CodeFile1.Text + SL_E);

            string strMsg; string strResult;

            BCO.CheckStockTakeItem(ParameterList, out strMsg, out strResult);

            ddlS.SelectedValue = SL_S;
            ddlE.SelectedValue = SL_E;

            string strStockDate = SLP_SLPDate1.Text;
            string strTakeUserId = SLP_User1.Text;


            if (strMsg.Trim() != "")
            {
                ScriptManager.RegisterStartupScript(Page, this.GetType(), "IVM042.aspx", "alert(' " + strMsg + " ');", true);
                return;
            }

            if (strResult != "1")//(strMsg.Trim() == "所指定儲位區間內包括已有盤點單或尚未凍結的儲位,請重新指定")
            {
                ScriptManager.RegisterStartupScript(this.UpdatePanel12, typeof(UpdatePanel), "隨便寫", "SetTimeout(function(){document.getElementById('" + this.ddlS.ClientID + "').focus();},1000);", true);
            }
            else
            {
                Response.Redirect("IVM042.aspx?PageMode=21&Code=IVM04&PageSize=" + TextBoxPagesize.Text + "&LOCATE_NO=" + this.SLP_CodeFile1.Text + "&LOCATE_SECTION_S=" + SL_S + "&LOCATE_SECTION_E=" + SL_E + "&StockDate=" + strStockDate + "&TakeUserId=" + strTakeUserId, false);
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {

        try
        {
            if (Session["IVM04QueryID"] != null)
            {
                IDList = (ArrayList)Session["IVM04QueryID"];
            }

            AuthorityControls(this);

            ErrorMsgLabel.Text = "";

            if (!Page.IsPostBack)
            {

                PageTimeStamp.Value = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");

                this.pnlAdd.Visible = true;
                this.txtStockTakeQty.Attributes["onblur"] = "CheckQty('ctl00_CPH_txtStockTakeQty')";
                this.pnlAdd.Visible = false;
                if (Request["PageMode"] == "1")
                {
                    this.hid_Page_Status.Value = "VIEW";

                    string strLocateNo; string strLocateS; string strLocateE; string strStockDate; string strStocktakeNo; string strTotalQty; string strTakeUserId; string strStatus;

                    IVMModel.MaintainStockTake BCO = new PIC.VDS2G.VSM.IVM.MaintainStockTake(ConntionDB);

                    DataTable dt = new DataTable();
                    dt = BCO.QueryByID(Request["ID"].ToString(), out strLocateNo, out strLocateS, out strLocateE, out strStockDate, out strStocktakeNo, out strTotalQty, out strTakeUserId, out strStatus);
                    dtForBrowse = dt;
                    OldDt = dt;

                    GridView1.DataSource = dt;
                    GridView1.PageSize = (TextBoxPagesize.Text == "") ? 20 : (int.Parse(TextBoxPagesize.Text) < 0) ? 20 : int.Parse(TextBoxPagesize.Text);
                    TextBoxPagesize.Text = GridView1.PageSize.ToString();
                    GridView1.PageIndex = 0;
                    GridView1.DataBind();

                    if (strStatus == "75")
                        ckbStatus.Checked = true;
                    else
                        ckbStatus.Checked = false;

                    SLP_CodeFile1.Text = strLocateNo;
                    Databind();

                    ddlS.SelectedValue = strLocateS;
                    ddlE.SelectedValue = strLocateE;
                    SLP_SLPDate1.Text = strStockDate;
                    lblStockTakeNo.Text = strStocktakeNo;
                    SLP_User1.Text = strTakeUserId;

                    ViewState["ddlS"] = this.ddlS.SelectedIndex > 0 ? this.ddlS.SelectedIndex : 0;
                    ViewState["ddlE"] = this.ddlE.SelectedIndex > 0 ? this.ddlE.SelectedIndex : 0;
                    ViewState["CodeFile"] = this.SLP_CodeFile1.DropDownListControl.SelectedIndex > 0 ? this.SLP_CodeFile1.DropDownListControl.SelectedIndex : 0;
                }
                else if (Request["PageMode"] == "2")
                {
                    this.hid_Page_Status.Value = "UPDATE";
                    IVMModel.MaintainStockTake BCO = new PIC.VDS2G.VSM.IVM.MaintainStockTake(ConntionDB);

                    string strLocateNo; string strLocateS; string strLocateE; string strStockDate; string strStocktakeNo; string strTotalQty; string strTakeUserId; string strStatus;
                    DataTable dt = new DataTable();
                    dt = BCO.QueryByID(Request["ID"].ToString(), out strLocateNo, out strLocateS, out strLocateE, out strStockDate, out strStocktakeNo, out strTotalQty, out strTakeUserId, out strStatus);
                    dtForBrowse = dt;
                    OldDt = dt;

                    GridView1.DataSource = dt;

                    GridView1.PageSize = int.Parse(Request["PageSize"]);
                    TextBoxPagesize.Text = Request["PageSize"];
                    GridView1.PageIndex = 0;
                    GridView1.DataBind();

                    if (strStatus == "75")
                        ckbStatus.Checked = true;
                    else
                        ckbStatus.Checked = false;

                    SLP_CodeFile1.Text = strLocateNo;
                    Databind();

                    ddlS.SelectedValue = strLocateS;
                    ddlE.SelectedValue = strLocateE;
                    SLP_SLPDate1.Text = strStockDate;
                    lblStockTakeNo.Text = strStocktakeNo;
                    SLP_User1.Text = strTakeUserId;

                    if (Request["StockTakeNo"] != null)
                    {
                        SLP_CodeFile1.Text = Request["CodeFile"].ToString();
                        this.ddlS.SelectedIndex = int.Parse(Request["SectionS"].ToString());
                        this.ddlE.SelectedIndex = int.Parse(Request["SectionE"].ToString());

                        SLP_SLPDate1.Text = Request["StockDate"].ToString();
                        lblStockTakeNo.Text = Request["StockTakeNo"].ToString();
                        SLP_User1.Text = Request["TakeuserId"].ToString();
                    }

                    ViewState["ddlS"] = this.ddlS.SelectedIndex > 0 ? this.ddlS.SelectedIndex : 0;
                    ViewState["ddlE"] = this.ddlE.SelectedIndex > 0 ? this.ddlE.SelectedIndex : 0;
                    ViewState["CodeFile"] = this.SLP_CodeFile1.DropDownListControl.SelectedIndex > 0 ? this.SLP_CodeFile1.DropDownListControl.SelectedIndex : 0;
                }
                else if (Request["PageMode"] == "21")
                {
                    //新增
                    this.hid_Page_Status.Value = "UPDATE2";
                    IVMModel.MaintainStockTake BCO = new PIC.VDS2G.VSM.IVM.MaintainStockTake(ConntionDB);

                    string strLocateNo = Request["LOCATE_NO"].ToString();
                    string strLocateS = Request["LOCATE_SECTION_S"].ToString();
                    string strLocateE = Request["LOCATE_SECTION_E"].ToString();
                    string strStockDate = Request["StockDate"].ToString();
                    string strStocktakeNo = string.Empty;
                    string strTotalQty = "0";
                    string strTakeUserId = Request["TakeUserId"];
                    string strStatus = string.Empty;

                    DataTable dt = new DataTable();
                    ParameterList.Clear();
                    ParameterList.Add(strLocateNo + strLocateS);
                    ParameterList.Add(strLocateNo + strLocateE);
                    dt = BCO.QueryStockTakeItem(ParameterList);

                    dtForBrowse = dt;
                    OldDt = dt;

                    GridView1.DataSource = dt;

                    GridView1.PageSize = int.Parse(Request["PageSize"]);
                    TextBoxPagesize.Text = Request["PageSize"];
                    GridView1.PageIndex = 0;
                    GridView1.DataBind();

                    ckbStatus.Checked = false;

                    SLP_CodeFile1.Text = strLocateNo;
                    Databind();

                    ddlS.SelectedValue = strLocateS;
                    ddlE.SelectedValue = strLocateE;
                    SLP_SLPDate1.Text = strStockDate;
                    lblStockTakeNo.Text = strStocktakeNo;
                    SLP_User1.Text = strTakeUserId;

                    ViewState["ddlS"] = this.ddlS.SelectedIndex > 0 ? this.ddlS.SelectedIndex : 0;
                    ViewState["ddlE"] = this.ddlE.SelectedIndex > 0 ? this.ddlE.SelectedIndex : 0;
                    ViewState["CodeFile"] = this.SLP_CodeFile1.DropDownListControl.SelectedIndex > 0 ? this.SLP_CodeFile1.DropDownListControl.SelectedIndex : 0;
                }
                else if (Request["PageMode"] == "3")
                {
                    this.hid_Page_Status.Value = "INSERT";
                    TextBoxPagesize.Text = (TextBoxPagesize.Text == "") ? "20" : (int.Parse(TextBoxPagesize.Text) < 0) ? "20" : TextBoxPagesize.Text;
                    IVMModel.MaintainStockTake BCO = new IVMModel.MaintainStockTake(ConntionDB);

                    SLP_CodeFile1.Text = "";
                    SLP_SLPDate1.Text = DateTime.Now.ToString("yyyy/MM/dd");
                    SLP_User1.Text = Session["UID"].ToString();
                    Databind();

                    ViewState["ddlS"] = this.ddlS.SelectedIndex > 0 ? this.ddlS.SelectedIndex : 0;
                    ViewState["ddlE"] = this.ddlE.SelectedIndex > 0 ? this.ddlE.SelectedIndex : 0;
                    ViewState["CodeFile"] = this.SLP_CodeFile1.DropDownListControl.SelectedIndex > 0 ? this.SLP_CodeFile1.DropDownListControl.SelectedIndex : 0;
                }
                GetPageDefault();

            }
            else
            {
                SaveBrowseData();
            }

            ToolBarInit();

            #region 檢查結束欄位一定要大於或等於開始欄位

            ddlS.Attributes.Add("onblur", "Check_End_GreaterThan_Begin('" + ddlS.ClientID + "','" + ddlE.ClientID + "');");
            ddlE.Attributes.Add("onblur", "Check_End_GreaterThan_Begin('" + ddlS.ClientID + "','" + ddlE.ClientID + "');");

            #endregion

            ScriptManager.RegisterStartupScript(Page, this.GetType(), "ChangeD1Text", "ChangeD1Text();", true);
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {

        }

    }
Пример #3
0
    }//databind

    private void databind_Dtl()
    {
        #region
        try
        {
            string SessionIDName = "IVM04_DTL_" + PageTimeStamp.Value;
            IVMModel.MaintainStockTake BCO = new PIC.VDS2G.VSM.IVM.MaintainStockTake(ConntionDB);
            string strID = "";

            if (Request.QueryString["ID"] != null)
            {
                strID = Request.QueryString["ID"].ToString();
            }
            else
            {
                strID = CraeteMainID;
            }

            string strLocateNo; string strLocateS; string strLocateE; string strStockDate; string strStocktakeNo; string strTotalQty; string strTakeUserId; string strStatus;
            DataTable Dt = new DataTable();
            Dt = BCO.QueryByID(strID, out strLocateNo, out strLocateS, out strLocateE, out strStockDate, out strStocktakeNo, out strTotalQty, out strTakeUserId, out strStatus);
            Session[SessionIDName] = Dt;
            GridView1.DataSource = Dt;
            GridView1.PageIndex = 0;
            GridView1.DataBind();
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
Пример #4
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (this.ddlBLocateSec.SelectedValue.Trim() == "" || this.SLP_SKU1.Text.Trim() == "" || this.SLP_ItemPeriod1.Text.Trim() == "" || this.txtStockTakeQty.Text.Trim() == "")
            {
                ScriptManager.RegisterStartupScript(Page, this.GetType(), "IVM042.aspx", "alert(' 資料輸入不完整! ');", true);
                return;
            }

            for (int i = 0; i < this.dtForBrowse.Rows.Count; i++)
            {
                string strLOCATE_SECTION = dtForBrowse.Rows[i]["LOCATE_SECTION"].ToString();
                string strITEM = dtForBrowse.Rows[i]["ITEM"].ToString();
                string strPERIOD = dtForBrowse.Rows[i]["PERIOD"].ToString();
                string strSTOCKTAKE_QTY = dtForBrowse.Rows[i]["STOCKTAKE_QTY"].ToString();

                if (strLOCATE_SECTION == ddlBLocateSec.SelectedValue && strITEM == SLP_SKU1.Text && strPERIOD == SLP_ItemPeriod1.Text)
                {
                    ScriptManager.RegisterStartupScript(Page, this.GetType(), "IVM042.aspx", "alert(' 此儲位商品已存在盤點表中! ');", true);

                    TextBox txtSKU = (TextBox)this.SLP_SKU1.FindControl("TextBoxCode");//訂單擷轉日
                    ScriptManager.RegisterStartupScript(this.UpdatePanel8, typeof(UpdatePanel), "隨便寫", "document.getElementById('" + txtSKU.ClientID + "').focus();", true);
                    return;
                }
            }

            IVMModel.MaintainStockTake BCO = new IVMModel.MaintainStockTake(ConntionDB);
            string strCost = "";
            BCO.GetCostByItem(SLP_SKU1.Text, SLP_ItemPeriod1.Text, out strCost);
            h_Cost.Value = strCost;

            DataRow dRow = dtForBrowse.NewRow();

            //ID和CODE暫自訂, 真正寫入CO時會重取
            int v_ID = tempID;
            int v_CODE = tempID;

            string strID = "";
            if (Request["PageMode"].ToString() == "21")
            {
                strID = "0";
            }
            else
            {
                if (Request.QueryString["ID"] != null)
                {
                    strID = Request.QueryString["ID"].ToString();
                }
                else
                {
                    strID = CraeteMainID;
                }
            }

            dRow["PID"] = int.Parse(strID);
            dRow["LOCATE_NO"] = this.SLP_CodeFile1.Text;
            dRow["LOCATE_SECTION"] = ddlBLocateSec.Text;
            dRow["ITEM"] = SLP_SKU1.Text;
            dRow["PERIOD"] = SLP_ItemPeriod1.Text;
            dRow["ITEM_NAME"] = SLP_SKU1.Name;
            dRow["ONHD_QTY"] = 0;
            dRow["STOCKTAKE_QTY"] = int.Parse(txtStockTakeQty.Text);
            dRow["STATUS"] = null;
            dRow["CREATEUID"] = Session["UID"].ToString();
            dRow["CREATEDATE"] = DateTime.Now;
            dRow["UPDATEUID"] = Session["UID"].ToString();
            dRow["UPDATEDATE"] = DateTime.Now; ;
            dRow["COST"] = strCost;
            dRow["SORT_ID"] = 2; //手動新增的為2
            dtForBrowse.Rows.Add(dRow);

            dtForBrowse.DefaultView.Sort = "SORT_ID,LOCATE_NO,LOCATE_SECTION,ITEM,PERIOD";
            GridView1.DataSource = dtForBrowse.DefaultView;
            GridView1.PageIndex = GridView1.PageCount - 1;
            GridView1.DataBind();
            SLP_SKU1.Text = "";
            SLP_ItemPeriod1.Text = "";
            txtStockTakeQty.Text = "";

            //GridView1.Sort("UPDATEDATE", SortDirection.Descending);

            ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(UpdatePanel), "SKU_FOCUS", "document.getElementById('" + SLP_SKU1.FindControl("TextBoxCode").ClientID + "').select();document.getElementById('" + SLP_SKU1.FindControl("TextBoxCode").ClientID + "').focus();", true);
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }
Пример #5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            int iCount = 0;

            for (int i = 0; i < dtForBrowse.Rows.Count; i++)
            {
                iCount += int.Parse(dtForBrowse.Rows[i]["STOCKTAKE_QTY"].ToString());
            }
            this.lblTotalQty.Text = iCount.ToString();
            IVMModel.MaintainStockTake BCO = new IVMModel.MaintainStockTake(ConntionDB);
            switch (Request["PageMode"])
            {
                case "2":

                    for (int i = 0; i < dtForBrowse.Rows.Count; i++)
                    {
                        ParameterList.Clear();
                        bool bl = true;
                        string strID = dtForBrowse.Rows[i]["ID"].ToString();
                        string strPID = dtForBrowse.Rows[i]["PID"].ToString();
                        string strLOCATE_NO = dtForBrowse.Rows[i]["LOCATE_NO"].ToString();
                        string strLOCATE_SECTION = dtForBrowse.Rows[i]["LOCATE_SECTION"].ToString();
                        string strITEM = dtForBrowse.Rows[i]["ITEM"].ToString();
                        string strPERIOD = dtForBrowse.Rows[i]["PERIOD"].ToString();
                        string strSTOCKTAKE_QTY = dtForBrowse.Rows[i]["STOCKTAKE_QTY"].ToString();
                        string strCREATEUID = dtForBrowse.Rows[i]["CREATEUID"].ToString();
                        string strCREATEDATE = dtForBrowse.Rows[i]["CREATEDATE"].ToString();
                        string strUPDATEUID = dtForBrowse.Rows[i]["UPDATEUID"].ToString();
                        string strUPDATEDATE = dtForBrowse.Rows[i]["UPDATEDATE"].ToString();
                        string strCOST = dtForBrowse.Rows[i]["COST"].ToString();

                        foreach (DataRow dr in OldDt.Rows)
                        {
                            bl = true;
                            if (dr["LOCATE_NO"].ToString() == strLOCATE_NO && dr["LOCATE_SECTION"].ToString() == strLOCATE_SECTION && dr["ITEM"].ToString() == strITEM && dr["PERIOD"].ToString() == strPERIOD && dr["STOCKTAKE_QTY"].ToString() != strSTOCKTAKE_QTY)
                            {
                                ParameterList.Add(int.Parse(dr["ID"].ToString()));
                                ParameterList.Add(int.Parse(strSTOCKTAKE_QTY));
                                ParameterList.Add(Session["UID"].ToString());
                                ParameterList.Add(DateTime.Parse(PageTimeStamp.Value));
                                ParameterList.Add(dr["UPDATEUID"].ToString());
                                ParameterList.Add(DateTime.Parse(dr["UPDATEDATE"].ToString()));
                                ParameterList.Add(dr["CREATEUID"].ToString());
                                ParameterList.Add(DateTime.Parse(dr["CREATEDATE"].ToString()));

                                BCO.UpdStockTake(ParameterList, DBT);
                                bl = false;
                                break;
                            }
                            else if ((dr["LOCATE_NO"].ToString() == strLOCATE_NO && dr["LOCATE_SECTION"].ToString() == strLOCATE_SECTION && dr["ITEM"].ToString() == strITEM && dr["PERIOD"].ToString() == strPERIOD))
                            {
                                bl = false;
                                break;
                            }
                        }
                        if (bl)
                        {
                            ParameterList.Add(int.Parse(strPID));
                            ParameterList.Add(strLOCATE_NO + strLOCATE_SECTION);
                            ParameterList.Add(strITEM);
                            ParameterList.Add(strPERIOD);
                            ParameterList.Add(int.Parse(strSTOCKTAKE_QTY));
                            ParameterList.Add(strCOST.Trim() == "" ? 0 : double.Parse(strCOST));
                            ParameterList.Add(Session["UID"].ToString());
                            ParameterList.Add(DateTime.Parse(PageTimeStamp.Value));
                            BCO.InsertStockTake(ParameterList, DBT);
                        }
                    }
                    Response.Redirect("IVM042.aspx?PageMode=1&Code=IVM04&ID=" + Request.QueryString["ID"], false);
                    break;

                case "21": //新增儲存

                    string V_STOCKTAKE_NO = string.Empty;
                    string N_ID = string.Empty;

                    string strLocateNo = Request["LOCATE_NO"].ToString();
                    string strLocateS = Request["LOCATE_SECTION_S"].ToString();
                    string strLocateE = Request["LOCATE_SECTION_E"].ToString();
                    string strStockDate = Request["StockDate"].ToString();
                    string strTakeUserId = Request["TakeUserId"];

                    ParameterList.Clear();
                    ParameterList.Add(strLocateNo + strLocateS);  //0.V_LOCATE_SECTION_S
                    ParameterList.Add(strLocateNo + strLocateE);  //1.V_LOCATE_SECTION_E
                    ParameterList.Add(strStockDate);              //2.V_STOCK_DATE
                    ParameterList.Add(strTakeUserId);             //3.V_TAKEUSER_ID
                    ParameterList.Add(Session["UID"].ToString()); //4.CREATEUID
                    ParameterList.Add(DateTime.Now);              //5.CREATEDATE
                    BCO.CreateStockTake2(ParameterList, dtForBrowse, out V_STOCKTAKE_NO, out N_ID);
                    ArrayList IDList = new ArrayList();
                    IDList.Clear();
                    IDList.Add(N_ID);
                    Session["IVM04QueryID"] = IDList;
                    Response.Redirect("IVM042.aspx?PageMode=1&Code=IVM04&ID=" + N_ID, false);
                    break;
                case "3":


                    break;

                default:
                    break;
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }
Пример #6
0
 protected void btnAddDetail_Click(object sender, EventArgs e)
 {
     pnlAdd.Visible = true;
     btnAddDetail.Enabled = false;
     IVMModel.MaintainStockTake BCO = new IVMModel.MaintainStockTake(ConntionDB);
     DataTable Dt = null;
     if (Request["PageMode"].ToString() == "2")
     {
         int iID = this.Request["ID"] != null ? int.Parse(this.Request["ID"].ToString().Trim()) : 0;
         Dt = BCO.GetLocateSection2(iID, lblStockTakeNo.Text, SLP_CodeFile1.Text + ddlS.SelectedValue, SLP_CodeFile1.Text + ddlE.SelectedValue);
     }
     else if (Request["PageMode"].ToString() == "21")
     {
         Dt = BCO.GetLocateSection3(SLP_CodeFile1.Text + ddlS.SelectedValue, SLP_CodeFile1.Text + ddlE.SelectedValue);
     }
     else
     {
         ErrorMsgLabel.Text = "模式錯誤";
         return;
     }
     this.ddlBLocateSec.DataSource = Dt;
     this.ddlBLocateSec.DataTextField = "LOCATE_SECTION";
     this.ddlBLocateSec.DataValueField = "LOCATE_SECTION";
     this.ddlBLocateSec.DataBind();
     this.ddlBLocateSec.Items.Insert(0, "     ");
     this.ddlBLocateSec.Focus();
     this.txtStockTakeQty.Attributes["onblur"] = "CheckQty('ctl00_CPH_txtStockTakeQty')";
     ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(UpdatePanel), "隨便寫", "document.getElementById('" + this.ddlBLocateSec.ClientID + "').focus();", true);
 }
Пример #7
0
    private void gvData()
    {
        ResultMsgLabel.Text = "";
        BCO.MaintainStockTake bco = new BCO.MaintainStockTake(ConntionDB);

        ArrayList aList = this.getParameterList();
        DataTable Dt;
        Dt = bco.QueryMainByFind(aList);
        if (Dt.Rows.Count == 0)
        {
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "IVM041.aspx", "alert(' 查無資料 ');", true);
        }
        Session["Data"] = Dt;
        this.GridView1.PageSize = (TextBoxPagesize.Text == "") ? 10 : (int.Parse(TextBoxPagesize.Text) < 0) ? 10 : int.Parse(TextBoxPagesize.Text);
        this.GridView1.DataSource = Dt;
        this.GridView1.DataBind();

        ArrayList IDList = new ArrayList();

        for (int i = 0; i < Dt.Rows.Count; i++)
        {
            IDList.Add(Dt.Rows[i]["ID"].ToString());
        }

        Session["IVM04QueryID"] = IDList;
    }
Пример #8
0
    }//Page_Init  

    protected void Page_Load(object sender, EventArgs e)
    {

        try
        {

            AuthorityControls(this);

            ErrorMsgLabel.Text = "";

            if (!Page.IsPostBack)
            {
                PageTimeStamp.Value = DateTime.Now.ToString("yyyyMMddHHmmss");

                TextBoxPagesize.Text = (TextBoxPagesize.Text == "") ? "20" : (int.Parse(TextBoxPagesize.Text) < 0) ? "20" : TextBoxPagesize.Text;

                string strID = Request.QueryString["ID"].ToString();

                IVMModel.MaintainStockTake BCO = new PIC.VDS2G.VSM.IVM.MaintainStockTake(ConntionDB);

                string strLocateNo; string strLocateS; string strLocateE; string strStockDate; string strStocktakeNo; string strTotalQty; string strTakeUserId; string strStatus;
                //取得主檔資料
                DataTable dt = new DataTable();
                dt = BCO.QueryByID(strID, out strLocateNo, out strLocateS, out strLocateE, out strStockDate, out strStocktakeNo, out strTotalQty, out strTakeUserId, out strStatus);

                SLP_CodeFile1.Text = strLocateNo;
                txtS.Text = strLocateS;
                txtE.Text = strLocateE;
                SLP_SLPDate1.Text = strStockDate;
                lblStockTakeNo.Text = strStocktakeNo;
                SLP_User1.Text = strTakeUserId;
                hdfPID.Value = strID;

                //因為只有新增資料 所以不需要用strTotalQty這個資料
                txtTotalQty.Text = "0";
                TextBoxNoBorder(txtTotalQty);

                //取得符合條件的儲格資料
                GetLOCATE_SECTION();

                //設定初始的明細資料
                Session["IVM043_DTL_" + PageTimeStamp.Value] = DT_SCHEMA();
                for (int i = 0; i < 15; i++)
                {
                    AddEmptyRow();
                }

                Databind();
                GetPageDefault();
                ScriptManager.RegisterStartupScript(Page, this.GetType(), "ChangeD1Text", "ChangeD1Text();", true);
            }
            ToolBarInit();

        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {

        }

    }