Esempio n. 1
0
 public void addTrinhKy_OnFormLoad()
 {
     //Ham nay XuanDT them vao
     try {
         //doan gan cac bien: doan nay co the phai thay doi ten bien cho phu hop
         mv_oRptDoc  = RptDoc;
         mv_oViewDoc = this.crptViewer;
         //ket thuc doan gan bien
         mv_oRptFieldObj = mv_oRptDoc.ReportDefinition.ReportObjects["Field150181"] as FieldObject;
         mv_oNguoiKy     = new cls_SignInfor(mv_oRptDoc.ToString(), "");
         //chkPrint_CheckedChanged(chkPrint, New System.EventArgs)
         if (mv_oNguoiKy._TonTai)
         {
             mv_oNguoiKy.setValueToRPT(ref mv_oRptFieldObj);
             if (mv_bSetContent)
             {
                 mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + mv_oNguoiKy.mv_NOI_DUNG.Replace("&NHANVIEN", globalVariables.gv_sStaffName).Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
             }
             else
             {
                 mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text = "";
             }
             mv_oViewDoc.ReportSource = RptDoc;
         }
         else
         {
             mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", RptDoc.ToString(), mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text);
         }
     }
     catch (Exception ex) {
         mv_oRptText = null;
         //an nut tuy chon di
         this.cmdTrinhKy.Visible = false;
     }
 }
Esempio n. 2
0
        public void addTrinhKy_OnFormLoad()
        {
            //Ham nay XuanDT them vao
            try
            {
                //doan gan cac bien: doan nay co the phai thay doi ten bien cho phu hop
                mv_oRptDoc  = RptDoc;
                mv_oViewDoc = this.crptViewer;
                //ket thuc doan gan bien

                mv_oRptFieldObj = GetTrinhky(RptDoc.ParameterFields);
                //  if (mv_oRptFieldObj == null) return;
                mv_oNguoiKy = new cls_SignInfor(string.IsNullOrEmpty(crptTrinhKyName) ? mv_oRptDoc.ToString() : crptTrinhKyName, "");
                //chkPrint_CheckedChanged(chkPrint, New System.EventArgs)
                if (mv_oNguoiKy._TonTai)
                {
                    SetParamAgain(RptDoc.ParameterFields);
                    //if (mv_bSetContent)
                    //{

                    //    mv_oRptDoc.ReportDefinition.ReportObjects["txtTrinhky"]..Text = mv_oNguoiKy.mv_NOI_DUNG.Replace("&NHANVIEN", globalVariables.gv_strTenNhanvien);

                    //}
                    //else
                    //{
                    //    mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text = "";
                    //}
                }
                else
                {
                    SetParamAgain(RptDoc.ParameterFields);
                    if (string.IsNullOrEmpty(crptTrinhKyName))
                    {
                        mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", RptDoc.ToString(), "");
                    }
                    else
                    {
                        mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", crptTrinhKyName, "");
                    }
                }
                mv_oViewDoc.ReportSource = RptDoc;
            }
            catch (Exception ex)
            {
                mv_oRptText = null;
                //an nut tuy chon di
                log.Error("Loi trong qua trinh load thong tin trih ky={0}", ex);
                this.cmdTrinhKy.Visible = false;
            }
        }
Esempio n. 3
0
 // private Logger log;
  public frmPrintPreview(string FormTitle, CrystalDecisions.CrystalReports.Engine.ReportDocument RptDoc, bool pv_bSetContent,bool pv_bDisplayPrintButton,string TitleReport)
      : base()
  {
      
      //This call is required by the Windows Form Designer.
      InitializeComponent();
      log = LogManager.GetCurrentClassLogger();
      Utility.loadIconToForm(this);
      //Add any initialization after the InitializeComponent() call
      this.Text = FormTitle;
      this.RptDoc = RptDoc;
      this.sTIEUDE = TitleReport;
      
      this.crptViewer.ReportSource = this.RptDoc;
      cmdTrinhKy.Visible = pv_bSetContent;
      mv_bSetContent = pv_bSetContent;
      this.crptViewer.ShowRefreshButton = false;
      this.crptViewer.ShowPrintButton = pv_bDisplayPrintButton;
      InitializeEvents();
      sTIEUDE = new cls_SignInfor().SetTieuDe(RptDoc.ToString(), sTIEUDE);
    
  }
Esempio n. 4
0
        public void addTrinhKy_OnFormLoad()
        {
            try
            {
                LoadPrintNumberByReportCode();

                mv_oRptFieldObj = GetTrinhky(this.crptViewer.ParameterFieldInfo);
                mv_oNguoiKy     = new cls_SignInfor(string.IsNullOrEmpty(mv_sReportFileName) ? RptDoc.ToString() : mv_sReportFileName, "");
                if (mv_oNguoiKy != null)
                {
                    if (mv_oNguoiKy._TonTai)
                    {
                        this.Text += " Ton tai TK";
                        SetParamAgain();
                    }
                    else
                    {
                        this.Text += " Ko Ton tai TK";
                        string sPvalue = "";
                        Utility.SetParameterValue(RptDoc, "txtTrinhky", sPvalue);
                    }
                }
                else
                {
                    Utility.ShowMsg("No Trình ký");
                }
                this.crptViewer.ReportSource = RptDoc;
            }
            catch (Exception ex)
            {
                mv_oRptText = null;
                Utility.CatchException("addTrinhKy_OnFormLoad-->", ex);
                this.cmdTrinhKy.Visible = false;
            }
        }
Esempio n. 5
0
        public void addTrinhKy_OnFormLoad()
        {
            //Ham nay XuanDT them vao
            try
            {
                //doan gan cac bien: doan nay co the phai thay doi ten bien cho phu hop
                mv_oRptDoc = RptDoc;
                mv_oViewDoc = this.crptViewer;
                //ket thuc doan gan bien

                mv_oRptFieldObj = GetTrinhky(RptDoc.ParameterFields);
              //  if (mv_oRptFieldObj == null) return;
                mv_oNguoiKy = new cls_SignInfor(string.IsNullOrEmpty(crptTrinhKyName) ? mv_oRptDoc.ToString() : crptTrinhKyName, "");
                //chkPrint_CheckedChanged(chkPrint, New System.EventArgs)
                if (mv_oNguoiKy._TonTai)
                {
                    SetParamAgain(RptDoc.ParameterFields);
                    //if (mv_bSetContent)
                    //{

                    //    mv_oRptDoc.ReportDefinition.ReportObjects["txtTrinhky"]..Text = mv_oNguoiKy.mv_NOI_DUNG.Replace("&NHANVIEN", globalVariables.gv_strTenNhanvien);

                    //}
                    //else
                    //{
                    //    mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text = "";
                    //}

                }
                else
                {
                    SetParamAgain(RptDoc.ParameterFields);
                    if (string.IsNullOrEmpty(crptTrinhKyName))
                        mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", RptDoc.ToString(), "");
                    else
                    {
                        mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", crptTrinhKyName, "");
                    }

                }
                mv_oViewDoc.ReportSource = RptDoc;
            }
            catch (Exception ex)
            {
                mv_oRptText = null;
                //an nut tuy chon di
                log.Error("Loi trong qua trinh load thong tin trih ky={0}", ex);
                this.cmdTrinhKy.Visible = false;
            }
        }
Esempio n. 6
0
	public void addTrinhKy_OnFormLoad()
	{
		//Ham nay XuanDT them vao
		try {
			//doan gan cac bien: doan nay co the phai thay doi ten bien cho phu hop
			mv_oRptDoc = RptDoc;
			mv_oViewDoc = this.crptViewer;
			//ket thuc doan gan bien
			mv_oRptFieldObj = mv_oRptDoc.ReportDefinition.ReportObjects["Field150181"] as FieldObject;
			mv_oNguoiKy = new cls_SignInfor(mv_oRptDoc.ToString(), "");
			//chkPrint_CheckedChanged(chkPrint, New System.EventArgs)
			if (mv_oNguoiKy._TonTai) {
				mv_oNguoiKy.setValueToRPT(ref mv_oRptFieldObj);
				if (mv_bSetContent)
				{
				    mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
				                                                                mv_oNguoiKy.mv_NOI_DUNG.Replace("&NHANVIEN",
				                                                                                                globalVariables.
				                                                                                                    gv_sStaffName).
				                                                                    Replace("#$X$#",
				                                                                            Strings.Chr(34) + "&Chr(13)&" +
				                                                                            Strings.Chr(34)) + Strings.Chr(34);

				}
				else {
					mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text = "";
				}
				mv_oViewDoc.ReportSource = RptDoc;
			}
			else {
				mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", RptDoc.ToString(), mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text);
			}
		}
		catch (Exception ex) {
			mv_oRptText = null;
			//an nut tuy chon di
            log.Error("Loi trong qua trinh load thong tin trih ky={0}",ex);
			this.cmdTrinhKy.Visible = false;
		}
	}