Beispiel #1
0
    private void GetCGD051Data(string txtStAcceptNo, string txtStAcceptDate, string ddlTypeNo, string txtOutNo, string txtChanNo, string txtStore, string txtRoute, string txtStep, string SLP_SignDate, string txtChanSourceNo, string txtEnable, string SLP_SKU1, string txtSLP_Gift, string SLP_Period)
    {
        //抓取本頁初次登記的時間
        string SessionIDName = "CGD052_01_" + Request.QueryString["SessionTimeStamp"];

        CGDModel.MaintainSTStoreItemQry BCO = new CGDModel.MaintainSTStoreItemQry(ConntionDB);

        DataTable Dt;
        ParameterList.Clear();

        ParameterList.Add(txtStAcceptNo.Trim());
        ParameterList.Add(txtStAcceptDate.Trim());
        ParameterList.Add(ddlTypeNo.Trim());
        ParameterList.Add(txtOutNo.Trim());
        ParameterList.Add(txtChanNo.Trim());
        ParameterList.Add(txtStore.Trim());
        ParameterList.Add(txtRoute.Trim());
        ParameterList.Add(txtStep.Trim());
        ParameterList.Add(SLP_SignDate.Trim());
        ParameterList.Add(txtChanSourceNo.Trim());
        ParameterList.Add("1");
        ParameterList.Add(SLP_SKU1.Trim());
        ParameterList.Add(txtSLP_Gift.Trim());
        ParameterList.Add(SLP_Period.Trim());

        Dt = BCO.QuerySwitch(CGDModel.CGDCommon.QueryType.QueryStAcceptMain, ParameterList);

        if (Dt.Rows.Count == 0)
        {
            ErrorMsgLabel.Text = "查無資料";
            //ScriptManager.RegisterStartupScript(Page, this.GetType(), "CGD051.aspx", "alert(' 查無資料 ');", true);
        }


        Session[SessionIDName] = Dt;
    }
Beispiel #2
0
    /// <summary>
    /// 查詢門市進貨單是否已出庫
    /// </summary>
    protected void checkStAcceptDate()
    {
        //抓取本頁初次登記的時間
        string SessionIDName = "CGD052_" + PageTimeStamp.Value;
        string StAcceptDate = Convert.ToDateTime(txtStAcceptDate.Text.Trim()).ToShortDateString();

        CGDModel.MaintainSTStoreItemQry BCO = new CGDModel.MaintainSTStoreItemQry(ConntionDB);

        DataTable Dt;
        ParameterList.Clear();

        ParameterList.Add(StAcceptDate);

        ALOOutNo = BCO.CheckALOOutNO(ParameterList);

        if (ALOOutNo == true)
        {
            Label10.Text = "(已出庫)";
            btnSave.Enabled = false;

            ToolBarInit(ALOOutNo);
        }
        else
        {
            Label10.Text = "";
            ToolBarInit(ALOOutNo);
        }
    }
Beispiel #3
0
    /// <summary>
    /// 儲存鈕
    /// </summary>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int UpdateRecord = 0;
        System.IO.TextReader tr; 

        //try
        //{
        //    string StAcceptDate = txtStAcceptDate.Text.Trim();

        //    CGDModel.MaintainSTStoreItemQry BCO = new CGDModel.MaintainSTStoreItemQry(ConntionDB);

        //    DataTable Dt;
        //    ParameterList.Clear();

        //    ParameterList.Add(StAcceptDate);

        //    ALOOutNo = BCO.CheckALOOutNO(ParameterList);

        //    if (ALOOutNo == true)
        //    {
        //        Label10.Text = "(門市進貨日日期已做出庫不可異動資料)";
        //    }
        //    else
        //    {
        //        Label10.Text = "";
        //    }


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

        try
        {
            //抓取本頁初次登記的時間
            string SessionIDName = "CGD052_" + PageTimeStamp.Value;

            CGDModel.MaintainSTStoreItemQry BCO = new CGDModel.MaintainSTStoreItemQry(ConntionDB);

            #region 取得畫面元件的值

            string v_ST_ACCEPT_NO = txtStAcceptNo.Text.Trim();
            DateTime v_UPDATEDATE = System.DateTime.Now;
            string v_UPDATEUID = Session["UID"].ToString();

            #endregion

            #region 使用XML轉回DataSet , 取得更新前舊值

            DataSet Ds = null;
            DataTable Dt = null;
            if (MasterOLDData.InnerHtml.ToString().Trim() != "")
            {
                Ds = new DataSet();
                System.IO.StringReader sr = new System.IO.StringReader(MasterOLDData.InnerHtml);
                Ds.ReadXml(sr);
                Dt = Ds.Tables[0];
            }

            #endregion


            string OLD_ST_ACCEPT_QTY = "";
            string NEW_ST_ACCEPT_QTY = "";

            for (int i = 0; i <= Dt.Rows.Count - 1; i++)
            {
                ParameterList.Clear();

                ParameterList.Add(v_ST_ACCEPT_NO);
                ParameterList.Add(Dt.Rows[i]["ITEM"]);
                ParameterList.Add(Dt.Rows[i]["PERIOD"]);
                ParameterList.Add(Dt.Rows[i]["VIRTUAL_CODE"]);
                ParameterList.Add(Dt.Rows[i]["LOCATE_NO"]);
                ParameterList.Add(Dt.Rows[i]["LOCATE_SECTION"]);

                for (int j = 0; j <= GridView1.Rows.Count - 1; j++)
                {
                    if ((((Label)(GridView1.Rows[j].FindControl("Label1"))).Text == Dt.Rows[i]["rownum"].ToString().Trim()))
                    {
                        if (((TextBox)(GridView1.Rows[j].FindControl("TextBox10"))).Text != "")
                        {
                            OLD_ST_ACCEPT_QTY = ((Label)(GridView1.Rows[j].FindControl("Label12"))).Text;//OLD_ST_ACCEPT_QTY
                            NEW_ST_ACCEPT_QTY = ((TextBox)(GridView1.Rows[j].FindControl("TextBox10"))).Text;//NEW_ST_ACCEPT_QTY

                            ParameterList.Add(((Label)(GridView1.Rows[j].FindControl("Label12"))).Text); //OLD_ST_ACCEPT_QTY
                            ParameterList.Add(((TextBox)(GridView1.Rows[j].FindControl("TextBox10"))).Text);//NEW_ST_ACCEPT_QTY

                            ((Label)(GridView1.Rows[j].FindControl("Label12"))).Text = ((TextBox)(GridView1.Rows[j].FindControl("TextBox10"))).Text;//把新值帶給舊值
                        }
                        else
                        {
                            ParameterList.Add(0);//OLD_ST_ACCEPT_QTY
                            ParameterList.Add(0);//NEW_ST_ACCEPT_QTY
                        }
                    }
                }

                ParameterList.Add(v_UPDATEDATE);
                ParameterList.Add(v_UPDATEUID);

                if (OLD_ST_ACCEPT_QTY != NEW_ST_ACCEPT_QTY)
                    BCO.UpdateStAcceptItem(ParameterList, null);
            }

            ErrorMsgLabel.Text = "儲存完畢";
            //ScriptManager.RegisterStartupScript(Page, this.GetType(), "CGD052.aspx", "alert(' 儲存完畢 ');", true);
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }
Beispiel #4
0
    /// <summary>
    /// databind 繫結查詢資料到GridView1
    /// </summary>
    private void databind(string StAcceptNo, string strITEM, string strVIRTUAL_CODE, string strPERIOD)
    {
        //抓取本頁初次登記的時間
        string SessionIDName = "CGD052_" + PageTimeStamp.Value;

        CGDModel.MaintainSTStoreItemQry BCO = new CGDModel.MaintainSTStoreItemQry(ConntionDB);

        DataTable Dt;
        ParameterList.Clear();

        ParameterList.Add(StAcceptNo);
        ParameterList.Add(strITEM);
        ParameterList.Add(strVIRTUAL_CODE);
        ParameterList.Add(strPERIOD);

        Dt = BCO.QuerySwitch(CGDModel.CGDCommon.QueryType.QueryStAcceptItem, ParameterList);

        if (Dt.Rows.Count == 0)
        {
            ErrorMsgLabel.Text = "無進貨數量資料";
            //ScriptManager.RegisterStartupScript(Page, this.GetType(), "CGD052.aspx", "alert(' 無進貨數量資料 ');", true);
        }

       

        #region 使用XML放置到前端資料

        MasterOLDData.InnerHtml = Dt.DataSet.GetXml();

        #endregion

        checkStAcceptDate();

        Session[SessionIDName] = Dt;
        GridView1.DataSource = Dt;
        //設定分頁大小
      
        GridView1.PageIndex = 0;
        GridView1.DataBind();
    }
Beispiel #5
0
    /// <summary>
    /// databindDDL 繫結查詢資料到DropDownList
    /// </summary>
    private void databindDDL()
    {
        CGDModel.MaintainSTStoreItemQry BCO = new CGDModel.MaintainSTStoreItemQry(ConntionDB);

        DataTable Dt;
        ParameterList.Clear();

        Dt = BCO.QuerySwitch(CGDModel.CGDCommon.QueryType.TypeNo, ParameterList);


        ddlTypeNo.DataSource = Dt;
        ddlTypeNo.DataTextField = "EXPLAIN";
        ddlTypeNo.DataValueField = "SCODE";
        ddlTypeNo.DataBind();
    }
Beispiel #6
0
    /// <summary>
    /// databind 繫結查詢資料到GridView1
    /// </summary>
    private void databind()
    {
        //抓取本頁初次登記的時間
        string SessionIDName = "CGD051_" + PageTimeStamp.Value;

        CGDModel.MaintainSTStoreItemQry BCO = new CGDModel.MaintainSTStoreItemQry(ConntionDB);

        DataTable Dt;
        ParameterList.Clear();

        ParameterList.Add(txtStAcceptNo.Text.Trim());
        ParameterList.Add(SLP_StAcceptDate.Text.Trim());
        ParameterList.Add(ddlTypeNo.SelectedItem.Value);
        ParameterList.Add(txtOutNo.Text.Trim());
        ParameterList.Add(txtChanNo.Text.Trim());
        ParameterList.Add(txtStore.Text.Trim());
        ParameterList.Add(txtRoute.Text.Trim());
        ParameterList.Add(txtStep.Text.Trim());
        ParameterList.Add(SLP_SignDate.Text.Trim());
        ParameterList.Add(txtChanSourceNo.Text.Trim());
        ParameterList.Add("1");
        ParameterList.Add(SLP_SKU1.Text.Trim());
        ParameterList.Add(txtSLP_Gift.Text.Trim());
        ParameterList.Add(SLP_Period.Text.Trim());

        Dt = BCO.QuerySwitch(CGDModel.CGDCommon.QueryType.QueryStAcceptMain, ParameterList);

        if (Dt.Rows.Count == 0)
        {
            ErrorMsgLabel.Text = "查無資料";
            //ScriptManager.RegisterStartupScript(Page, this.GetType(), "CGD051.aspx", "alert(' 查無資料 ');", true);
        }

        #region 使用XML放置到前端資料

        MasterOLDData.InnerHtml = Dt.DataSet.GetXml();

        #endregion

        Session[SessionIDName] = Dt;
        GridView1.DataSource = Dt;
        //設定分頁大小
        GridView1.PageIndex = 0;
        GridView1.DataBind();
    }