Esempio n. 1
0
 private bool CheckInvDeclareType(string strYM)
 {
     //判斷此筆資料是否已媒體申報
     CAAModel.ProcessInvoiceChange BCO = new CAAModel.ProcessInvoiceChange(ConntionDB);
     ParameterList.Clear();
     ParameterList.Add(strYM);
     return BCO.CheckInvDeclareType(ParameterList);
 }
Esempio n. 2
0
 private bool CheckInvExist(string strINV_NO)
 {
     //判斷此筆資料是否作廢
     bool bResult = false;
     CAAModel.ProcessInvoiceChange BCO = new CAAModel.ProcessInvoiceChange(ConntionDB);
     ParameterList.Clear();
     ParameterList.Add(strINV_NO);
     DataTable dt = BCO.CheckInvExist(ParameterList);
     if (dt.Rows.Count == 0) //沒有資料=沒有作廢
         bResult = false;
     else
         bResult = true;
     return bResult;
 }
Esempio n. 3
0
 private bool CheckInvData(string strINV_NO)
 {
     //檢查發票資料是否被折讓折抵
     bool bResult = false;
     CAAModel.ProcessInvoiceChange BCO = new CAAModel.ProcessInvoiceChange(ConntionDB);
     ParameterList.Clear();
     ParameterList.Add(strINV_NO);
     DataTable dt = BCO.CheckInvData(ParameterList);
     if (dt.Rows.Count == 0)
         bResult = false;
     else
         bResult = true;
     return bResult;
 }
Esempio n. 4
0
 private int CHGInvByChange(GridViewRow grdRow)
 {
     CAAModel.ProcessInvoiceChange BCO = new CAAModel.ProcessInvoiceChange(ConntionDB);
     //@發票號碼、@型式、@結帳統編、@品名、@銷售金額、@稅額、@抬頭、@更新日期、@更新人、@原始更新日期、@原始更新人    
     HiddenField hdfINV_NO = (HiddenField)grdRow.FindControl("hdfINV_NO");
     HiddenField hdfUPDATEDATE = (HiddenField)grdRow.FindControl("hdfUPDATEDATE");
     HiddenField hdfUPDATEUID = (HiddenField)grdRow.FindControl("hdfUPDATEUID");
     TextBox txtVOUCH_RFNO = (TextBox)grdRow.FindControl("txtVOUCH_RFNO");
     TextBox txtTITLE = (TextBox)grdRow.FindControl("txtTITLE");
     TextBox txtITEM_NAME = (TextBox)grdRow.FindControl("txtITEM_NAME");
     TextBox txtINV_UAMT = (TextBox)grdRow.FindControl("txtINV_UAMT");
     TextBox txtINV_TAX = (TextBox)grdRow.FindControl("txtINV_TAX");
     TextBox txtINV_AMT = (TextBox)grdRow.FindControl("txtINV_AMT");
     DropDownList slp_INV_FORM = (DropDownList)((ASP.sys_slp_slp_codefile_ascx)grdRow.FindControl("slp_INV_FORM")).FindControl("D1");
     
     ParameterList.Clear();
     ParameterList.Add(hdfINV_NO.Value);
     ParameterList.Add(hdfType.Value);
     ParameterList.Add(txtVOUCH_RFNO.Text);
     ParameterList.Add(slp_INV_FORM.SelectedValue);
     ParameterList.Add(txtTITLE.Text);
     ParameterList.Add(txtITEM_NAME.Text);
     ParameterList.Add(txtINV_UAMT.Text);
     ParameterList.Add(txtINV_TAX.Text);
     ParameterList.Add(txtINV_AMT.Text);
     ParameterList.Add(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));
     ParameterList.Add(Session["UID"].ToString());
     ParameterList.Add(hdfUPDATEDATE.Value);
     ParameterList.Add(hdfUPDATEUID.Value);
     return BCO.CHGInvByChange(ParameterList, null);
 }
Esempio n. 5
0
    private int CancelInvByChange(GridViewRow grdRow)
    {
        HiddenField hdfINV_NO = (HiddenField)grdRow.FindControl("hdfINV_NO");
        HiddenField hdfUPDATEDATE = (HiddenField)grdRow.FindControl("hdfUPDATEDATE");
        HiddenField hdfUPDATEUID = (HiddenField)grdRow.FindControl("hdfUPDATEUID");
        ASP.wui_slp_slp_slpdate_ascx slp_CANCEL_DATE = (ASP.wui_slp_slp_slpdate_ascx)grdRow.FindControl("slp_CANCEL_DATE");

        CAAModel.ProcessInvoiceChange BCO = new CAAModel.ProcessInvoiceChange(ConntionDB);
        ParameterList.Clear();
        ParameterList.Add(hdfINV_NO.Value);
        ParameterList.Add(slp_CANCEL_DATE.Text);
        ParameterList.Add(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));
        ParameterList.Add(Session["UID"].ToString());
        ParameterList.Add(hdfUPDATEDATE.Value);
        ParameterList.Add(hdfUPDATEUID.Value);
        return BCO.CancelInvByChange(ParameterList, null);
    }
Esempio n. 6
0
    protected void btnCommit_Click(object sender, EventArgs e)
    {
        GV_WriteToCache();
        ErrorMsgLabel.Text = "";
        if (CheckSumAmt() == false)
        {
            ErrorMsgLabel.Text = "異動失敗,換開發票之銷售金額總合需與原發票金額相同";
        }
        else if (CheckChanMonthClose(SLP_SLPDate1.Text.Replace("/", "").Substring(0, 6)) == true)
        {
            ErrorMsgLabel.Text = "字軌已月結,無法金額換開";
        }
        else if (CheckZero() == false)
        {
            ErrorMsgLabel.Text = "銷售金額欄位不得小於1";
        }
        else
        {
            string SessionName_DT = "CAA22DT_" + PageTimeStamp.Value;

            CAAModel.ProcessInvoiceChange BCO = new CAAModel.ProcessInvoiceChange(ConntionDB);
            ParameterList.Clear();
            ParameterList.Add(txtINV_NO.Text.Trim());
            ParameterList.Add(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(hdfUPDATEDATE_Q.Value);
            ParameterList.Add(hdfUPDATEUID_Q.Value);
            ParameterList.Add((DataTable)Session[SessionName_DT]);
            ParameterList.Add(SLP_SLPDate1.Text);
            ParameterList.Add(SLP_INVOICE_TYPE.Text);
            BCO.CHGInvOneToMore(ParameterList);

            ErrorMsgLabel.Text = "換開成功";
            ViewState["SaveOK"] = "OK";
            Disable_Commit();
            Load_MoreData(txtINV_NO.Text.Trim());
            UpdatePanelGV1.Update();
        }
        up_ErrorMsg.Update();
    }
Esempio n. 7
0
    private void Load_MoreData(string strINV_NO)
    {
        CAAModel.ProcessInvoiceChange BCO = new CAAModel.ProcessInvoiceChange(ConntionDB);

        ParameterList.Clear();
        ParameterList.Add(strINV_NO);

        DataTable dt = BCO.QueryInvoiceByMore(ParameterList);

        string SessionName_DT = "CAA22DT_" + PageTimeStamp.Value;

        Session[SessionName_DT] = dt;


        GridView1.PageSize = 1000;
        GridView1.PageIndex = 0;

        Bind_Data();

        EmptyGridFix(GridView1);


    }
Esempio n. 8
0
    private void Query_Data()
    {
        //0.@結帳年月
        //1.@店號
        //2.@結帳統編
        //3.@統一編號
        //4.@原開立日期
        //5.@原發票金額_OP 0:> 1:= 2:<
        //6.@原發票金額
        //7.@商品群分類
        //8.@稅別
        //9.@發票性質
        //10.@發票號碼            
        CAAModel.ProcessInvoiceChange BCO = new CAAModel.ProcessInvoiceChange(ConntionDB);
        ArrayList ParameterList = new ArrayList(); //因為原來的ParameterList是全域變數放到Viewstate後會跟著變動,所以自己在宣告一個
        ParameterList.Clear();
        if (ViewState["Para_Query"] == null)
        {
            ParameterList.Add(SLP_YearMonth1.Text);
            ParameterList.Add(SLP_Store1.Text);
            ParameterList.Add(txtPAY_RFNO.Text);
            ParameterList.Add(txtVOUCH_RFNO.Text);
            ParameterList.Add(SLP_SLPDate1.Text);
            ParameterList.Add(SLP_SLPNumber1.Operator);
            ParameterList.Add(SLP_SLPNumber1.Text);
            ParameterList.Add(SLP_RootNo1.Text);
            ParameterList.Add(rblTaxType.SelectedValue);
            ParameterList.Add(SLP_INVOICE_TYPE.Text);
            ParameterList.Add(txtINV_NO.Text.Trim());
            Int32 iTopRownum;
            Int32.TryParse(TextBoxRowCountLimit.Text.Trim(), out iTopRownum);
            ParameterList.Add(iTopRownum.ToString());
            ViewState["Para_Query"] = ParameterList;
        }
        else
        {
            ParameterList = (ArrayList)ViewState["Para_Query"];
        }

        DataTable dt = BCO.QueryInvoiceByChange(ParameterList);

        string SessionName_DT = "CAA22DT_" + PageTimeStamp.Value;

        Session[SessionName_DT] = dt;

        if (dt.Rows.Count > 0)
        {
            hdfType.Value = SLP_EnumBase1.Text;
            switch (SLP_EnumBase1.Text.Trim())
            {
                case "1": //"一對多換開"                    
                    Bind_OneToMore(dt);
                    break;
                case "2": //"金額換開":
                case "3": //"統編換開":
                case "4": //"品名換開":
                case "5": //"發票作廢":      
                    GridView1.PageSize = (TextBoxPagesize.Text == "") ? 20 : (int.Parse(TextBoxPagesize.Text) < 0) ? 20 : int.Parse(TextBoxPagesize.Text);
                    GridView1.PageIndex = 0;
                    Bind_Data();
                    break;
            }
        }
        else
        {
            GridView1.DataSource = null;
            GridView1.DataBind();
            ErrorMsgLabel.Text = "查無資料";
        }
        up_ErrorMsg.Update();
        UpdatePanelCommit.Update();
    }