Example #1
0
    private void Databind()
    {
        BCO.MaintainStockTakeFreeze bco = new BCO.MaintainStockTakeFreeze(ConntionDB);

        DataTable Dt = null;

        Dt = bco.QueryLocateSection(this.SLP_CodeFile1.Text);
        this.ddlS.DataSource = Dt;
        this.ddlS.DataTextField = "LOCATE_SECTION";
        this.ddlS.DataValueField = "LOCATE_SECTION";
        this.ddlS.DataBind();
        this.ddlS.Items.Insert(0, "     ");

        this.ddlE.DataSource = Dt;
        this.ddlE.DataTextField = "LOCATE_SECTION";
        this.ddlE.DataValueField = "LOCATE_SECTION";
        this.ddlE.DataBind();
        this.ddlE.Items.Insert(0, "     ");
    }
Example #2
0
    protected void btnUnFree_Click(object sender, EventArgs e)
    {
        DataTable Dt = (DataTable)ViewState["Data"];
        
        BCO.MaintainStockTakeFreeze bco = new BCO.MaintainStockTakeFreeze(ConntionDB);
        
        for (int i = 0; Dt.Rows.Count > i; i++)
        {
            string strCount = "";
            
            ArrayList aList = new ArrayList();
            aList.Add(GetValueSetParameter(Dt.Rows[i]["LOCATE_NO"].ToString(), "string"));
            aList.Add(GetValueSetParameter(Dt.Rows[i]["LOCATE_SECTION"].ToString(), "string"));
            aList.Add(GetValueSetParameter(Dt.Rows[i]["FREEZE_DATE"].ToString(), "datetime"));
            aList.Add(GetValueSetParameter(DateTime.Parse((Dt.Rows[i]["UPDATEDATE"].ToString())).ToString("yyyy/MM/dd hhmmss"), "string"));

            bco.QueryCheckTime(aList, out strCount);
            if (int.Parse(strCount) == 0)
            {
                ScriptManager.RegisterStartupScript(Page, this.GetType(), "IVM031.aspx", "alert(' 資料已被其他使用者異動,更新失敗 ');", true);
                return;
            }
        }

        //for (int i = 0; Dt.Rows.Count > i; i++)
        //{
        //    BCO.MaintainStockTakeFreeze bco = new BCO.MaintainStockTakeFreeze(ConntionDB);
        //    ArrayList aList = new ArrayList();
        //    aList.Add(GetValueSetParameter(Dt.Rows[i]["LOCATE_NO"].ToString(), "string"));
        //    aList.Add(GetValueSetParameter(Dt.Rows[i]["LOCATE_SECTION"].ToString(), "string"));
        //    aList.Add(GetValueSetParameter(Dt.Rows[i]["FREEZE_DATE"].ToString(), "datetime"));
        //    //aList.Add(GetValueSetParameter(PageTimeStamp.Value, "datetime"));
        //    aList.Add(GetValueSetParameter(Session["UID"].ToString(), "string"));

            bco.UpdUnFreezeLocateSec(Dt, Session["UID"].ToString(), DBT);

        //}
        this.gvData();
    }
Example #3
0
    private DataTable queryData()
    {
        ResultMsgLabel.Text = "";
        BCO.MaintainStockTakeFreeze bco = new BCO.MaintainStockTakeFreeze(ConntionDB);

        DataTable Dt = null;
        Dt = bco.PrintRpt01();
        return Dt;
    }
Example #4
0
    private void gvData()
    {
        ResultMsgLabel.Text = "";
        string strFreeze = string.Empty;
        string strUnFreeze = string.Empty;
        BCO.MaintainStockTakeFreeze bco = new BCO.MaintainStockTakeFreeze(ConntionDB);

        ArrayList aList = this.getParameterList();
        DataTable Dt;
        Dt = bco.QueryByFind(aList, out strFreeze, out strUnFreeze);
        if (Dt.Rows.Count == 0)
        {
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "IVM031.aspx", "alert(' 查無資料 ');", true);
        }
        ViewState["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();
    }
Example #5
0
    private void Databind()
    {
        BCO.MaintainStockTakeFreeze bco = new BCO.MaintainStockTakeFreeze(ConntionDB);

        DataTable Dt = null;

        Dt = bco.QueryLocateSection(this.SLP_CodeFile1.Text);
        this.ddlS.DataSource = Dt;
        this.ddlS.DataTextField = "LOCATE_SECTION";
        this.ddlS.DataValueField = "LOCATE_SECTION";
        this.ddlS.DataBind();
        this.ddlS.Items.Insert(0, "     ");
        this.ddlE.DataSource = Dt;
        this.ddlE.DataTextField = "LOCATE_SECTION";
        this.ddlE.DataValueField = "LOCATE_SECTION";
        this.ddlE.DataBind();
        this.ddlE.Items.Insert(0, "     ");
        if (ViewState["SLP_CodeFile1"] == null)
        {
            ViewState["ddlS"] = 0;
            ViewState["ddlE"] = 0;
        }
        else
        {
            if (ViewState["SLP_CodeFile1"].ToString() != this.SLP_CodeFile1.Text)
            {
                ViewState["ddlS"] = 0;
                ViewState["ddlE"] = 0;
            }
        }
        ViewState["SLP_CodeFile1"] = this.SLP_CodeFile1.Text;
    }
Example #6
0
    private void GetLOCATE_SECTION()
    {
        BCO.MaintainStockTakeFreeze bco = new BCO.MaintainStockTakeFreeze(ConntionDB);
        DataTable dt = bco.QueryLocateSection(this.SLP_CodeFile1.Text);

        DataTable TempTable = new DataTable();
        TempTable.Columns.Add(new DataColumn("LOCATE_SECTION"));

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            if (((String.Compare(dt.Rows[i]["LOCATE_SECTION"].ToString().Trim(), txtS.Text, true) > 0) && (String.Compare(dt.Rows[i]["LOCATE_SECTION"].ToString().Trim(), txtE.Text, true) < 0)) ||
                (dt.Rows[i]["LOCATE_SECTION"].ToString().Trim().ToUpper() == txtS.Text.ToUpper()) ||
                (dt.Rows[i]["LOCATE_SECTION"].ToString().Trim().ToUpper() == txtE.Text.ToUpper()))
            {
                DataRow dr = TempTable.NewRow();
                dr["LOCATE_SECTION"] = dt.Rows[i]["LOCATE_SECTION"].ToString();
                TempTable.Rows.Add(dr);
            }
        }
        TempTable.AcceptChanges();
        Session["IVM043_SECTION_" + PageTimeStamp.Value] = TempTable;
    }