Пример #1
0
        private void SalePosReport_Load(object sender, EventArgs e)
        {
            if (Cas == 1)
            {
                SalePosNew.crtSaleInv Crv2 = new SalePosNew.crtSaleInv();
                Crv2.SetDataSource(Dt);
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 2)
            {
                SalePosNew.crtPackingThai Crv2 = new SalePosNew.crtPackingThai();
                Crv2.SetDataSource(Dt);
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 3)
            {
                SalePosNew.crtSaleInvMalay Crv2 = new SalePosNew.crtSaleInvMalay();
                Crv2.SetDataSource(Dt);
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 21)
            {
                int cros_s = 0;
                int l1 = 1, l2 = 1, l3 = 1, l4 = 1, l5 = 1, l6 = 1;
                int s1 = 1, s2 = 1, s3 = 1;
                BarcodeLib.Barcode barcode = new BarcodeLib.Barcode()
                {
                    IncludeLabel = true,
                    Alignment = AlignmentPositions.CENTER,
                    Width = 200,
                    Height = 70,
                    RotateFlipType = RotateFlipType.RotateNoneFlipNone,
                    BackColor = Color.White,
                    ForeColor = Color.Black,
                };

                Image img = barcode.Encode(TYPE.CODE128B, "123456789");

                SalePosNew.CtrDetail2 Crv = new SalePosNew.CtrDetail2();

                //var pic = Crv.ReportDefinition.ReportObjects["picBarcode"] as PictureObject;
                //pic.

                if (Convert.ToDouble(Dt.Rows[0]["CompanyAddressEng"].ToString()) == 0) { cros_s = cros_s + 1; }
                else { l1 = 0; }
                if (Convert.ToDouble(Dt.Rows[0]["CompanyPhone"].ToString()) == 0) { cros_s = cros_s + 1; }
                else { l2 = 0; }
                if (Convert.ToDouble(Dt.Rows[0]["CompanyFax"].ToString()) == 0) { cros_s = cros_s + 1; }
                else { l3 = 0; }
                if (Convert.ToDouble(Dt.Rows[0]["CompanyCode"].ToString()) == 0) { cros_s = cros_s + 1; }
                else { l4 = 0; }
                if (Convert.ToDouble(Dt.Rows[0]["LocationProductName"].ToString()) == 0) { cros_s = cros_s + 1; }
                else { l5 = 0; }
                if (Convert.ToDouble(Dt.Rows[0]["CreditTerm"].ToString()) == 0) { cros_s = cros_s + 1; }
                else { l6 = 0; }

                if (Convert.ToDouble(Dt.Rows[0]["Dis"].ToString()) != 0) { s1 = 0; }
                if (Convert.ToDouble(Dt.Rows[0]["Vat"].ToString()) != 0) { s2 = 0; }
                if (Convert.ToDouble(Dt.Rows[0]["DiscountBth"].ToString()) != 0) { s3 = 0; }

                //Line 1
                ReportObject field_before = Crv.ReportDefinition.ReportObjects["CompanyPhone1"];
                ReportObject text = Crv.ReportDefinition.ReportObjects["Text30"];
                ReportObject field_after = Crv.ReportDefinition.ReportObjects["CompanyNameEng7"];
                FieldObject fieldObject = (FieldObject)field_before;
                TextObject textObject = (TextObject)text;
                FieldObject field2Object = (FieldObject)field_after;
                int top = fieldObject.Top;
                fieldObject.Top = top - l1 * 360;
                textObject.Top = top - l1 * 360;
                field2Object.Top = top - l1 * 360;

                //Line 2
                ReportObject field_before1 = Crv.ReportDefinition.ReportObjects["CompanyFax1"];
                ReportObject text1 = Crv.ReportDefinition.ReportObjects["Text53"];
                ReportObject field_after1 = Crv.ReportDefinition.ReportObjects["CompanyNameEng8"];
                FieldObject fieldObject1 = (FieldObject)field_before1;
                TextObject textObject1 = (TextObject)text1;
                FieldObject field2Object1 = (FieldObject)field_after1;
                int top1 = fieldObject1.Top;
                fieldObject1.Top = top1 - (l1 + l2) * 360;
                textObject1.Top = top1 - (l1 + l2) * 360;
                field2Object1.Top = top1 - (l1 + l2) * 360;

                //Line 3
                ReportObject field_before2 = Crv.ReportDefinition.ReportObjects["CompanyCode1"];
                ReportObject text2 = Crv.ReportDefinition.ReportObjects["Text52"];
                ReportObject field_after2 = Crv.ReportDefinition.ReportObjects["CompanyNameEng9"];
                FieldObject fieldObject2 = (FieldObject)field_before2;
                TextObject textObject2 = (TextObject)text2;
                FieldObject field2Object2 = (FieldObject)field_after2;
                int top2 = fieldObject2.Top;
                fieldObject2.Top = top2 - (l1 + l2 + l3) * 360;
                textObject2.Top = top2 - (l1 + l2 + l3) * 360;
                field2Object2.Top = top2 - (l1 + l2 + l3) * 360;

                //Line 4
                ReportObject field_before3 = Crv.ReportDefinition.ReportObjects["LocationProductName1"];
                ReportObject text3 = Crv.ReportDefinition.ReportObjects["Text51"];
                ReportObject field_after3 = Crv.ReportDefinition.ReportObjects["CompanyNameEng10"];
                FieldObject fieldObject3 = (FieldObject)field_before3;
                TextObject textObject3 = (TextObject)text3;
                FieldObject field2Object3 = (FieldObject)field_after3;
                int top3 = fieldObject3.Top;
                fieldObject3.Top = top3 - (l1 + l2 + l3 + l4) * 360;
                textObject3.Top = top3 - (l1 + l2 + l3 + l4) * 360;
                field2Object3.Top = top3 - (l1 + l2 + l3 + l4) * 360;

                //Line 5
                ReportObject field_before4 = Crv.ReportDefinition.ReportObjects["CreditTerm1"];
                ReportObject text4 = Crv.ReportDefinition.ReportObjects["Text50"];
                ReportObject field_after4 = Crv.ReportDefinition.ReportObjects["CompanyNameEng11"];
                FieldObject fieldObject4 = (FieldObject)field_before4;
                TextObject textObject4 = (TextObject)text4;
                FieldObject field2Object4 = (FieldObject)field_after4;
                int top4 = fieldObject4.Top;
                fieldObject4.Top = top4 - (l1 + l2 + l3 + l4 + l5) * 360;
                textObject4.Top = top4 - (l1 + l2 + l3 + l4 + l5) * 360;
                field2Object4.Top = top4 - (l1 + l2 + l3 + l4 + l5) * 360;

                //Line 6
                ReportObject field_before5 = Crv.ReportDefinition.ReportObjects["PurchaseOrderDetailId1"];
                ReportObject text5 = Crv.ReportDefinition.ReportObjects["Text47"];
                ReportObject field_after5 = Crv.ReportDefinition.ReportObjects["CompanyNameEng12"];
                FieldObject fieldObject5 = (FieldObject)field_before5;
                TextObject textObject5 = (TextObject)text5;
                FieldObject field2Object5 = (FieldObject)field_after5;
                int top5 = fieldObject5.Top;
                fieldObject5.Top = top5 - (l1 + l2 + l3 + l4 + l5 + l6) * 360;
                textObject5.Top = top5 - (l1 + l2 + l3 + l4 + l5 + l6) * 360;
                field2Object5.Top = top5 - (l1 + l2 + l3 + l4 + l5 + l6) * 360;

                //Sum Price
                //Line S 1
                ReportObject field_s1 = Crv.ReportDefinition.ReportObjects["Vat1"];
                ReportObject text_s1 = Crv.ReportDefinition.ReportObjects["RateVat1"];
                ReportObject field_sa1 = Crv.ReportDefinition.ReportObjects["CompanyNameEng3"];
                FieldObject fieldObject_s1 = (FieldObject)field_s1;
                FieldObject textObject_s1 = (FieldObject)text_s1;
                FieldObject field2Object_s1 = (FieldObject)field_sa1;
                int top_s1 = fieldObject_s1.Top;
                fieldObject_s1.Top = top_s1 - (s1) * 360;
                textObject_s1.Top = top_s1 - (s1) * 360;
                field2Object_s1.Top = top_s1 - (s1) * 360;
                //Line S 2
                ReportObject field_s2 = Crv.ReportDefinition.ReportObjects["DiscountBth1"];
                ReportObject text_s2 = Crv.ReportDefinition.ReportObjects["Text13"];
                ReportObject field_sa2 = Crv.ReportDefinition.ReportObjects["CompanyNameEng4"];
                FieldObject fieldObject_s2 = (FieldObject)field_s2;
                TextObject textObject_s2 = (TextObject)text_s2;
                FieldObject field2Object_s2 = (FieldObject)field_sa2;
                int top_s2 = fieldObject_s2.Top;
                fieldObject_s2.Top = top_s2 - (s1+s2) * 360;
                textObject_s2.Top = top_s2 - (s1+s2) * 360;
                field2Object_s2.Top = top_s2 - (s1+s2) * 360;
                //Line S 3
                ReportObject field_s3 = Crv.ReportDefinition.ReportObjects["TotalPrice1"];
                ReportObject text_s3 = Crv.ReportDefinition.ReportObjects["Text12"];
                ReportObject field_sa3 = Crv.ReportDefinition.ReportObjects["CompanyNameEng5"];
                FieldObject fieldObject_s3 = (FieldObject)field_s3;
                TextObject textObject_s3 = (TextObject)text_s3;
                FieldObject field2Object_s3 = (FieldObject)field_sa3;
                int top_s3 = fieldObject_s3.Top;
                fieldObject_s3.Top = top_s3 - (s1 + s2+s3) * 360;
                textObject_s3.Top = top_s3 - (s1 + s2+s3) * 360;
                field2Object_s3.Top = top_s3 - (s1 + s2+s3) * 360;
                //End sum price

                //Point under line
                ReportObject UnderLine = Crv.ReportDefinition.ReportObjects["Text4"];
                TextObject TextUndetLine = (TextObject)UnderLine;

                ReportObject VerticleLine2 = Crv.ReportDefinition.ReportObjects["Line2"];
                LineObject BVerticleLine2 = (LineObject)VerticleLine2;

                ReportObject VerticleLine1 = Crv.ReportDefinition.ReportObjects["Line1"];
                LineObject BVerticleLine1 = (LineObject)VerticleLine1;

                if (fieldObject5.Top > fieldObject_s3.Top)
                {
                    if (fieldObject5.Top < 1640)
                    {
                        TextUndetLine.Top = 1640;
                        BVerticleLine2.Bottom = 1790;
                        BVerticleLine1.Bottom = 1790;
                    }
                    else
                    {
                        TextUndetLine.Top = textObject5.Top + 100;
                        BVerticleLine2.Bottom = textObject5.Top + 250;
                        BVerticleLine1.Bottom = textObject5.Top + 250;
                    }
                }
                else
                {
                    if (fieldObject_s3.Top < 1640)
                    {
                        TextUndetLine.Top = 1640;
                        BVerticleLine2.Bottom = 1790;
                        BVerticleLine1.Bottom = 1790;
                    }
                    else
                    {
                        TextUndetLine.Top = fieldObject_s3.Top + 100;
                        BVerticleLine2.Bottom = fieldObject_s3.Top + 250;
                        BVerticleLine1.Bottom = fieldObject_s3.Top + 250;
                    }
                }

                //End point under line

                Crv.SetDataSource(Dt);
                //Crv.Subreports["Img_Barcode"].Database.Tables[0].SetDataSource(dtImg);
                CtrReceiveSelect.ReportSource = Crv;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 22)
            {
                SalePosNew.crtSaleVat2 Crv2 = new SalePosNew.crtSaleVat2();
                Crv2.SetDataSource(Dt);
                double amnt = Convert.ToDouble(Dt.Rows[0]["ProductPackWeight"]);
                string textBath = Class.Function.GetBathtext(amnt);
                ((TextObject)Crv2.Section4.ReportObjects["Text29"]).Text = "(" + textBath + ")";
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 31)
            {
                SalePosNew.crtSaleRe2 Crv2 = new SalePosNew.crtSaleRe2();
                Crv2.SetDataSource(Dt);
                double amnt = Convert.ToDouble(Dt.Rows[0]["PriceTotal"]);
                string textBath = Class.Function.GetBathtext(amnt);
                ((TextObject)Crv2.Section4.ReportObjects["ToWordBath"]).Text = "(" + textBath + ")";
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 32)
            {
                SalePosNew.crtRecCrd3 Crv2 = new SalePosNew.crtRecCrd3();
                Crv2.SetDataSource(Dt);
                double amnt = Convert.ToDouble(Dt.Rows[0]["PriceTotal"]);
                string textBath = Class.Function.GetBathtext(amnt);
                ((TextObject)Crv2.Section4.ReportObjects["ToWordBath"]).Text = "(" + textBath + ")";
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 33)
            {
                SalePosNew.crtIncCrd3 Crv2 = new SalePosNew.crtIncCrd3();
                Crv2.SetDataSource(Dt);
                double amnt = Convert.ToDouble(Dt.Rows[0]["cash"]);
                string textBath = Class.Function.GetBathtext(amnt);
                ((TextObject)Crv2.Section4.ReportObjects["ToWordBath"]).Text = "(" + textBath + ")";
                Crv2.SetParameterValue("base", Class.DBConnString.sDb);
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 37)
            {
                SalePosNew.crtIncCrd33 Crv2 = new SalePosNew.crtIncCrd33();
                Crv2.SetDataSource(Dt);
                double amnt = Convert.ToDouble(Dt.Rows[0]["cash"]);
                string textBath = Class.Function.GetBathtext(amnt);
                //((TextObject)Crv2.Section4.ReportObjects["ToWordBath"]).Text = "(" + textBath + ")";
                string com = Class.DBConnString.sDb;
                string addr = "";
                string tel = "";
                string fax = "";
                if (com == "KTC" || com== "KTC_TEST")
                {
                    DataTable company = Class.DBConnString.clsDB.QueryDataTable("SELECT * FROM Company WHERE CompanyCatalog = '" + com + "'");
                    if (company.Rows.Count > 0)
                    {
                        DataRow r = company.Rows[0];
                        com = r["CompanyNameEng"].ToString();//"KTC NETTING CO.,LTD";
                        addr = "OFFICE : " + r["CompanyAddressEng"].ToString();
                        tel = "TEL : +66-" + r["CompanyPhone"].ToString();
                        fax = "FAX : +66-" + r["CompanyFax"].ToString();
                    }
                }
                string salehead = Dt.Rows[0]["saleheadid"].ToString();
                string sql = "select c.salecurrencyname from sale_head_view h inner join currency c " +
                "on h.salecurrencyid1 = c.salecurrencyid " +
                "where saleheadid = '" + salehead + "'";
                string cur = "";
                cur = Class.DBConnString.clsDB.QueryExecuteScalar(sql);
                if (cur == "" || cur == null)
                {
                    MessageBox.Show("รายงานนี้ไม่ระบุสกุลเงิน ไม่สามารถออกรายงานนี้ได้");
                    return;
                }
                Crv2.SetParameterValue("base", com);
                Crv2.SetParameterValue("addr", addr);
                Crv2.SetParameterValue("tel", tel);
                Crv2.SetParameterValue("fax", fax);
                Crv2.SetParameterValue("cur", cur);
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 34)
            {
                SalePosNew.crtReduceCrd2 Crv2 = new SalePosNew.crtReduceCrd2();
                Crv2.SetDataSource(Dt);
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 35)
            {
                SalePosNew.crtIncCrd2 Crv2 = new SalePosNew.crtIncCrd2();
                Crv2.SetDataSource(Dt);
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 36)
            {
                SalePosNew.crtIncCrd4 Crv2 = new SalePosNew.crtIncCrd4();
                Crv2.SetDataSource(Dt);
                double amnt = Convert.ToDouble(Dt.Rows[0]["cash"]);
                string textBath = Class.Function.GetBathtext(amnt);
                ((TextObject)Crv2.Section4.ReportObjects["ToWordBath"]).Text = "(" + textBath + ")";
                Crv2.SetParameterValue("base", Class.DBConnString.sDb);
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 38)
            {
                SalePosNew.crtIncCrd44 Crv2 = new SalePosNew.crtIncCrd44();
                Crv2.SetDataSource(Dt);
                double amnt = Convert.ToDouble(Dt.Rows[0]["cash"]);
                string textBath = Class.Function.GetBathtext(amnt);
                //((TextObject)Crv2.Section4.ReportObjects["ToWordBath"]).Text = "(" + textBath + ")";
                string com = Class.DBConnString.sDb;
                string addr = "";
                string tel = "";
                string fax = "";
                if (com == "KTC" || com == "KTC_TEST")
                {
                    DataTable company = Class.DBConnString.clsDB.QueryDataTable("SELECT * FROM Company WHERE CompanyCatalog = '" + com + "'");
                    if (company.Rows.Count > 0)
                    {
                        DataRow r = company.Rows[0];
                        com = r["CompanyNameEng"].ToString();//"KTC NETTING CO.,LTD";
                        addr = "OFFICE : " + r["CompanyAddressEng"].ToString();
                        tel = "TEL : +66-" + r["CompanyPhone"].ToString();
                        fax = "FAX : +66-" + r["CompanyFax"].ToString();
                    }

                    //com = //"KTC NETTING CO.,LTD";
                    //addr = "OFFICE : 555/9 MOO 2 T. PAWONG A.MUANG SONKHLA 90100 THAILAND";
                    //tel = "TEL 66-074-333031-3";
                    //fax = "FAX. 166-074-330004";
                }
                string salehead = Dt.Rows[0]["saleheadid"].ToString();
                string sql = "select c.salecurrencyname from sale_head_view h inner join currency c "+
                "on h.salecurrencyid1 = c.salecurrencyid "+
                "where saleheadid = '" + salehead + "'";
                string cur = "";
                cur = Class.DBConnString.clsDB.QueryExecuteScalar(sql);
                if (cur == "" || cur == null) {
                    MessageBox.Show("รายงานนี้ไม่ระบุสกุลเงิน ไม่สามารถออกรายงานนี้ได้");
                    return;
                }
                Crv2.SetParameterValue("base", com);
                Crv2.SetParameterValue("addr", addr);
                Crv2.SetParameterValue("tel", tel);
                Crv2.SetParameterValue("fax", fax);
                Crv2.SetParameterValue("cur", cur);

                //var txt = Crv2.ReportDefinition.ReportObjects["txtCustomerName"] as TextObject;
                //txt.Text = "";

                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 41)
            {
                SalePosNew.crtTransStore Crv2 = new SalePosNew.crtTransStore();
                Crv2.SetDataSource(Dt);
                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 51)
            {
                SalePosNew.crtAdjustmentStore Crv = new SalePosNew.crtAdjustmentStore();
                Crv.SetDataSource(Dt);
                CtrReceiveSelect.ReportSource = Crv;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
            if (Cas == 52)
            {
                SalePosNew.crtSaleReEng Crv2 = new SalePosNew.crtSaleReEng();
                Crv2.SetDataSource(Dt);
                string com = Class.DBConnString.sDb;
                string addr = "";
                string tel = "";
                string fax = "";
                if (com == "KTC" || com == "KTC_TEST")
                {
                    DataTable company = Class.DBConnString.clsDB.QueryDataTable("SELECT * FROM Company WHERE CompanyCatalog = '" + com + "'");
                    if (company.Rows.Count > 0)
                    {
                        DataRow r = company.Rows[0];
                        com = r["CompanyNameEng"].ToString();//"KTC NETTING CO.,LTD";
                        addr = "OFFICE : " + r["CompanyAddressEng"].ToString();
                        tel = "TEL : +66-" + r["CompanyPhone"].ToString();
                        fax = "FAX : +66-" + r["CompanyFax"].ToString();
                    }

                    //com = //"KTC NETTING CO.,LTD";
                    //addr = "OFFICE : 555/9 MOO 2 T. PAWONG A.MUANG SONKHLA 90100 THAILAND";
                    //tel = "TEL 66-074-333031-3";
                    //fax = "FAX. 166-074-330004";
                }
                string salehead = Dt.Rows[0]["saleheadid"].ToString();
                string sql = "select c.salecurrencyname from sale_head_view h inner join currency c " +
                "on h.salecurrencyid1 = c.salecurrencyid " +
                "where saleheadid = '" + salehead + "'";
                string cur = "";
                cur = Class.DBConnString.clsDB.QueryExecuteScalar(sql);
                if (cur == "" || cur == null)
                {
                    MessageBox.Show("รายงานนี้ไม่ระบุสกุลเงิน ไม่สามารถออกรายงานนี้ได้");
                    return;
                }
                Crv2.SetParameterValue("base", com);
                Crv2.SetParameterValue("addr", addr);
                Crv2.SetParameterValue("tel", tel);
                Crv2.SetParameterValue("fax", fax);
                Crv2.SetParameterValue("cur", cur);

                CtrReceiveSelect.ReportSource = Crv2;
                CtrReceiveSelect.Refresh();
                CtrReceiveSelect.Show();
            }
        }
Пример #2
0
 private void COReport2_Load(object sender, EventArgs e)
 {
     if (Cas == 1)
     {
         StockAsiaDrink.crtBillDate Crv = new StockAsiaDrink.crtBillDate();
         Crv.SetDataSource(Dt);
         //Crv.SetParameterValue("com", Class.DBConnString.clsDB.QueryExecuteScalar(Com));
         Crv.SetParameterValue("com", Com);
         Crv.SetParameterValue("sdate", Sd);
         Crv.SetParameterValue("edate", Ed);
         CtrReceiveSelect.ReportSource = Crv;
     }
     if (Cas == 2)
     {
         StockAsiaDrink.crtCoBillPro Crv = new StockAsiaDrink.crtCoBillPro();
         Crv.SetDataSource(Dt);
         //Crv.SetParameterValue("com", Class.DBConnString.clsDB.QueryExecuteScalar(Com));
         Crv.SetParameterValue("com", Com);
         Crv.SetParameterValue("sdate", Sd);
         Crv.SetParameterValue("edate", Ed);
         CtrReceiveSelect.ReportSource = Crv;
     }
     if (Cas == 3)
     {
         StockAsiaDrink.crtCoBillStock Crv = new StockAsiaDrink.crtCoBillStock();
         Crv.SetDataSource(Dt);
         //Crv.SetParameterValue("com", Class.DBConnString.clsDB.QueryExecuteScalar(Com));
         Crv.SetParameterValue("com", Com);
         Crv.SetParameterValue("sdate", Sd);
         Crv.SetParameterValue("edate", Ed);
         CtrReceiveSelect.ReportSource = Crv;
     }
     if (Cas == 11)
     {
         StockAsiaDrink.crtBringDate Crv = new StockAsiaDrink.crtBringDate();
         Crv.SetDataSource(Dt);
         Crv.SetParameterValue("com", Com);
         Crv.SetParameterValue("sdate", Sd);
         Crv.SetParameterValue("edate", Ed);
         CtrReceiveSelect.ReportSource = Crv;
     }
     if (Cas == 12)
     {
         StockAsiaDrink.crtCoBringPro Crv = new StockAsiaDrink.crtCoBringPro();
         Crv.SetDataSource(Dt);
         Crv.SetParameterValue("com", Com);
         Crv.SetParameterValue("sdate", Sd);
         Crv.SetParameterValue("edate", Ed);
         CtrReceiveSelect.ReportSource = Crv;
     }
     //Edit value in stock consignment
     if (Cas == 21)
     {
         StockAsiaDrink.crtAdjustment Crv = new StockAsiaDrink.crtAdjustment();
         Crv.SetDataSource(Dt);
         CtrReceiveSelect.ReportSource = Crv;
         CtrReceiveSelect.Refresh();
         CtrReceiveSelect.Show();
     }
     //End edit value in stock consignment
     //Sent product to stock consignment
     if (Cas == 31)
     {
         StockAsiaDrink.crtCoSentDate Crv = new StockAsiaDrink.crtCoSentDate();
         Crv.SetDataSource(Dt);
         Crv.SetParameterValue("com", Com);
         Crv.SetParameterValue("sdate", Sd);
         Crv.SetParameterValue("edate", Ed);
         CtrReceiveSelect.ReportSource = Crv;
     }
     if (Cas == 32)
     {
         StockAsiaDrink.crtCoSentPro Crv = new StockAsiaDrink.crtCoSentPro();
         Crv.SetDataSource(Dt);
         Crv.SetParameterValue("com", Com);
         Crv.SetParameterValue("sdate", Sd);
         Crv.SetParameterValue("edate", Ed);
         CtrReceiveSelect.ReportSource = Crv;
     }
     if (Cas == 33)
     {
         StockAsiaDrink.crtCoSentStock Crv = new StockAsiaDrink.crtCoSentStock();
         Crv.SetDataSource(Dt);
         Crv.SetParameterValue("com", Com);
         Crv.SetParameterValue("sdate", Sd);
         Crv.SetParameterValue("edate", Ed);
         CtrReceiveSelect.ReportSource = Crv;
     }
     if (Cas == 34)
     {
         StockAsiaDrink.crtCoSentShipper Crv = new StockAsiaDrink.crtCoSentShipper();
         Crv.SetDataSource(Dt);
         Crv.SetParameterValue("com", Com);
         Crv.SetParameterValue("sdate", Sd);
         Crv.SetParameterValue("edate", Ed);
         CtrReceiveSelect.ReportSource = Crv;
     }
     //End Sent product to stock consignment
     if (Cas == 41)
     {
         StockAsiaDrink.crtDayReport Crv = new StockAsiaDrink.crtDayReport();
         Crv.SetDataSource(Dt);
         Crv.SetParameterValue("_DateBegin", Sd_);
         Crv.SetParameterValue("_DateEnd", Ed_);
         CtrReceiveSelect.ReportSource = Crv;
         CtrReceiveSelect.Refresh();
         CtrReceiveSelect.Show();
     }
     if (Cas == 51)
     {
         ProductionNew.crtPrisonWage Crv = new ProductionNew.crtPrisonWage();
         Crv.SetDataSource(Dt);
         CtrReceiveSelect.ReportSource = Crv;
         CtrReceiveSelect.Refresh();
         CtrReceiveSelect.Show();
     }
     if (Cas == 61)
     {
         SalePosNew.crtPackingThai Crv = new SalePosNew.crtPackingThai();
         Crv.SetDataSource(Dt);
         CtrReceiveSelect.ReportSource = Crv;
         CtrReceiveSelect.Refresh();
         CtrReceiveSelect.Show();
     }
     if (Cas == 62){
         if(this.TO == ""){
             SalePosNew.crtSaleInvMalay Crv = new SalePosNew.crtSaleInvMalay();
             Crv.SetDataSource(Dt);
             CtrReceiveSelect.ReportSource = Crv;
         }else{
             SalePosNew.crtSaleInvMalaySingapore Crv = new SalePosNew.crtSaleInvMalaySingapore();
             Crv.SetDataSource(Dt);
             CtrReceiveSelect.ReportSource = Crv;
         }
         CtrReceiveSelect.Refresh();
         CtrReceiveSelect.Show();
     }
     if (Cas == 63)
     {
         SalePosNew.crtPackingMalay Crv = new SalePosNew.crtPackingMalay();
         Crv.SetDataSource(Dt);
         CtrReceiveSelect.ReportSource = Crv;
         CtrReceiveSelect.Refresh();
         CtrReceiveSelect.Show();
     }
     if (Cas == 71)
     {
         ProductionNew.crtAdjustMetFail Crv = new ProductionNew.crtAdjustMetFail();
         Crv.SetDataSource(Dt);
         CtrReceiveSelect.ReportSource = Crv;
         CtrReceiveSelect.Refresh();
         CtrReceiveSelect.Show();
     }
 }