Esempio n. 1
0
        /// <summary>
        /// 產生VAM09第三張報表_對帳單明細
        /// </summary>
        /// <param name="ParameterList">變數清單</param>
        /// <returns>回傳查詢結果</returns>
        public DataTable VAM09_3(ArrayList ParameterList)
        {
            VAMModel.VAM09_BCO BCO = new VAMModel.VAM09_BCO(ConntionDB);

            DataTable Dt = BCO.QueryVendorCheckSheetDetl(ParameterList);

            if (Dt.Rows.Count > 0)
            {
                return Dt;
            }
            else
            {
                throw new Exception("查無資料!!");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 產生VAM09第四張報表_對帳單單品
        /// </summary>
        /// <param name="ParameterList">變數清單</param>
        /// <returns>回傳查詢結果</returns>
        public DataSet VAM09_4(ArrayList ParameterList)
        {
            VAMModel.VAM09_BCO BCO = new VAMModel.VAM09_BCO(ConntionDB);

            DataTable Dt1 = BCO.QueryVendorSKUCheckSheet(ParameterList);

            DataTable Dt2 = BCO.QueryVendorSKUReturnCheckSheet(ParameterList);
            

            #region 重組DATATABLE
            DataTable dt_rpt1 = this.MakeDTForRptD();            

            if (Dt1.Rows.Count > 0)
            {
                for (int i = 0; i < Dt1.Rows.Count; i++)
                {
                    DataRow drA = dt_rpt1.NewRow();
                    drA[0] = Dt1.Rows[i][0].ToString();
                    drA[1] = Dt1.Rows[i][1].ToString();
                    drA[2] = Dt1.Rows[i][2].ToString();
                    drA[3] = Dt1.Rows[i][3].ToString();
                    drA[4] = "";//RPT_TYPE
                    drA[5] = Dt1.Rows[i][4].ToString();
                    drA[6] = Dt1.Rows[i][5].ToString();
                    drA[7] = Dt1.Rows[i][6].ToString();
                    drA[8] = Convert.ToDecimal(Dt1.Rows[i][7].ToString());
                    drA[9] = Convert.ToDecimal(Dt1.Rows[i][8].ToString());
                    drA[10] = "進貨數";//ACCEPT_FIELD
                    drA[11] = Dt1.Rows[i][9].ToString();
                    drA[12] = "退貨數";//RETURN_FIELD
                    drA[13] = Dt1.Rows[i][10].ToString();
                    drA[14] = "銷售量";//SALE_FIELD
                    drA[15] = Convert.ToDecimal(Dt1.Rows[i][11].ToString());
                    drA[16] = Convert.ToDecimal(Dt1.Rows[i][12].ToString());
                    drA[17] = Convert.ToDecimal(Dt1.Rows[i][13].ToString());
                    drA[18] = Convert.ToDecimal(Dt1.Rows[i][14].ToString());
                    drA[19] = Convert.ToDecimal(Dt1.Rows[i][15].ToString());
                    dt_rpt1.Rows.Add(drA);
                }
            }

            if (Dt2.Rows.Count > 0)
            {
                for (int i = 0; i < Dt2.Rows.Count; i++)
                {
                    DataRow drA = dt_rpt1.NewRow();
                    drA[0] = Dt2.Rows[i][0].ToString();
                    drA[1] = Dt2.Rows[i][1].ToString();
                    drA[2] = Dt2.Rows[i][2].ToString();
                    drA[3] = Dt2.Rows[i][3].ToString();
                    drA[4] = "廠退日大於期別結束日";//RPT_TYPE
                    drA[5] = Dt2.Rows[i]["ITEM"].ToString();
                    drA[6] = Dt2.Rows[i]["ITEM_NAME"].ToString();
                    drA[7] = Dt2.Rows[i]["PERIOD"].ToString();
                    drA[8] = Convert.ToDecimal(Dt2.Rows[i]["PRICE"].ToString());
                    drA[9] = Convert.ToDecimal(Dt2.Rows[i]["COST"].ToString());
                    drA[10] = "退貨日期";//ACCEPT_FIELD
                    drA[11] = Convert.ToDateTime(Dt2.Rows[i]["RETURN_DATE"].ToString()).ToShortDateString();
                    drA[12] = "退貨單號";//RETURN_FIELD
                    drA[13] = Dt2.Rows[i]["RETURN_NO"].ToString();
                    drA[14] = "退貨數量";//SALE_FIELD
                    drA[15] = Convert.ToDecimal(Dt2.Rows[i]["RETURN_QTY"].ToString());
                    drA[16] = Convert.ToDecimal(Dt2.Rows[i]["ONHD_QTY"].ToString());
                    drA[17] = Convert.ToDecimal(Dt2.Rows[i][13].ToString());
                    drA[18] = Convert.ToDecimal(Dt2.Rows[i][14].ToString());
                    drA[19] = Convert.ToDecimal(Dt2.Rows[i][15].ToString());
                    dt_rpt1.Rows.Add(drA);
                }
            }
                       
            #endregion

            if (dt_rpt1.Rows.Count > 0)
            {
                DataTable Dt3 = BCO.QueryVAM094SetIsMark(ParameterList);
                DataTable dt_rpt2 = dt_rpt1.Clone();
                if (Dt3.Rows.Count > 0)
                {                    
                    for (int i = 0; i < Dt3.Rows.Count; i++)
                    {
                        DataRow drA = dt_rpt2.NewRow();
                        drA[0] = Dt3.Rows[i][0].ToString();
                        drA[1] = Dt3.Rows[i][1].ToString();
                        drA[2] = Dt3.Rows[i][2].ToString();
                        drA[3] = Dt3.Rows[i][3].ToString();
                        drA[4] = "已結帳資料,僅供參考";//RPT_TYPE
                        drA[5] = Dt3.Rows[i]["ITEM"].ToString();
                        drA[6] = Dt3.Rows[i]["ITEM_NAME"].ToString();
                        drA[7] = Dt3.Rows[i]["PERIOD"].ToString();
                        drA[8] = Convert.ToDecimal(Dt3.Rows[i]["PRICE"].ToString());
                        drA[9] = Convert.ToDecimal(Dt3.Rows[i]["COST"].ToString());
                        drA[10] = "進貨數";//ACCEPT_FIELD
                        drA[11] = Dt3.Rows[i]["ACCEPT_QTY"].ToString();
                        drA[12] = "退貨數";//RETURN_FIELD
                        drA[13] = Dt3.Rows[i]["RETURN_QTY"].ToString();
                        drA[14] = "銷售量";//SALE_FIELD
                        drA[15] = Convert.ToDecimal(Dt3.Rows[i]["SALES_QTY"].ToString());
                        drA[16] = Convert.ToDecimal(Dt3.Rows[i]["IS_MARK"].ToString());
                        drA[17] = 0;
                        drA[18] = 0;
                        drA[19] = 0;
                        dt_rpt2.Rows.Add(drA);
                    }
                }

                DataSet ds_Return = new DataSet();
                dt_rpt1.TableName = "VAM094_R1";
                dt_rpt2.TableName = "VAM094_R2";
                ds_Return.Tables.Add(dt_rpt1.Copy());
                ds_Return.Tables.Add(dt_rpt2.Copy());
                dt_rpt1.Dispose();
                dt_rpt2.Dispose();
                return ds_Return;
            }
            else
            {
                throw new Exception("查無資料!!");
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 產生VAM09第六張報表_【實銷結-結清】
        /// </summary>
        /// <param name="ParameterList">變數清單</param>
        /// <returns>回傳查詢結果</returns>
        public DataTable VAM09_6(ArrayList ParameterList)
        {
            VAMModel.VAM09_BCO BCO = new VAMModel.VAM09_BCO(ConntionDB);

            DataTable Dt = BCO.QueryVdsVamSalesClear(ParameterList);

            if (Dt.Rows.Count > 0)
            {
                return Dt;
            }
            else
            {
                throw new Exception("查無資料!!");
            }
        }