예제 #1
0
        public void addTrinhKy_OnButtonClick()
        {
            if (mv_oRptFieldObj == null)
            {
                return;
            }

            try {
                //Hien form de thay doi tuy chon ky
                frm_SignInfor sv_fTuyChonKy = new frm_SignInfor();
                sv_fTuyChonKy.txtBaoCao.Text = this.mv_oNguoiKy.mv_TEN_BIEUBC;
                //sv_fTuyChonKy.txtCoChu.Text = Me.mv_oNguoiKy.mv_CO_CHU.ToString()

                //sv_fTuyChonKy.txtKieuFont.Text = Me.mv_oNguoiKy.mv_KIEU_CHU
                //#$X$# cua XuanDT, khong duoc doi
                sv_fTuyChonKy.txtNoiDungKy.Text = this.mv_oNguoiKy.mv_NOI_DUNG.Replace("#$X$#", Constants.vbCrLf);
                //sv_fTuyChonKy.txtTenFont.Text = Me.mv_oNguoiKy.mv_FONT_CHU
                sv_fTuyChonKy.mv_sFontName  = this.mv_oNguoiKy.mv_FONT_CHU;
                sv_fTuyChonKy.mv_sFontSize  = this.mv_oNguoiKy.mv_CO_CHU.ToString();
                sv_fTuyChonKy.mv_sFontStyle = this.mv_oNguoiKy.mv_KIEU_CHU;
                sv_fTuyChonKy.ShowDialog();
                if (sv_fTuyChonKy.mv_bChapNhan)
                {
                    this.mv_oNguoiKy.mv_TEN_BIEUBC = sv_fTuyChonKy.txtBaoCao.Text.Trim();
                    this.mv_oNguoiKy.mv_CO_CHU     = Convert.ToInt32(sv_fTuyChonKy.cboFontSize.SelectedItem.ToString());
                    //Me.mv_oNguoiKy.mv_CHIEU_DAI = Val(sv_fTuyChonKy.txtDai.Text.Trim)
                    this.mv_oNguoiKy.mv_KIEU_CHU = sv_fTuyChonKy.cboFontStyle.SelectedItem.ToString();
                    if (!mv_bAdded)
                    {
                        this.mv_oNguoiKy.mv_NOI_DUNG = sv_fTuyChonKy.txtNoiDungKy.Text.Replace(Constants.vbCrLf, "#$X$#") + " ";
                    }
                    else
                    {
                        this.mv_oNguoiKy.mv_NOI_DUNG = sv_fTuyChonKy.txtNoiDungKy.Text.Replace(Constants.vbCrLf, "#$X$#").Substring(0, sv_fTuyChonKy.txtNoiDungKy.Text.Length - 1);
                    }
                    //Me.mv_oNguoiKy.mv_CHIEU_RONG = Val(sv_fTuyChonKy.txtRong.Text.Trim)
                    this.mv_oNguoiKy.mv_FONT_CHU = sv_fTuyChonKy.cboFontName.SelectedItem.ToString();
                    //Me.mv_oNguoiKy.mv_TOADO_NGANG = Val(sv_fTuyChonKy.txtViTriX.Text.Trim)
                    //Me.mv_oNguoiKy.mv_TOADO_DOC = Val(sv_fTuyChonKy.txtViTriY.Text.Trim)
                    if (sv_fTuyChonKy.chkGhiLai.Checked == true)
                    {
                        this.mv_oNguoiKy.updateRPTtoDB();
                    }
                    mv_oNguoiKy.setValueToRPT(ref mv_oRptFieldObj);
                    SetParamAgain(mv_oViewDoc.ParameterFieldInfo);
                    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 = Nothing
                    mv_oViewDoc.ReportSource = RptDoc;
                }
            }
            catch (Exception ex) {
            }
        }
예제 #2
0
	public void addTrinhKy_OnButtonClick()
	{
		if (mv_oRptFieldObj == null) return;
 
		try {
			//Hien form de thay doi tuy chon ky
			frm_SignInfor sv_fTuyChonKy = new frm_SignInfor();
           // sv_fTuyChonKy.mv_sTieuDe = sTIEUDE;
			sv_fTuyChonKy.txtBaoCao.Text = this.mv_oNguoiKy.mv_TEN_BIEUBC;
			//sv_fTuyChonKy.txtCoChu.Text = Me.mv_oNguoiKy.mv_CO_CHU.ToString()

			//sv_fTuyChonKy.txtKieuFont.Text = Me.mv_oNguoiKy.mv_KIEU_CHU
			//#$X$# cua XuanDT, khong duoc doi
			sv_fTuyChonKy.txtNoiDungKy.Text = this.mv_oNguoiKy.mv_NOI_DUNG.Replace("#$X$#", Constants.vbCrLf);
            sv_fTuyChonKy.txtTieuDe.Text = String.IsNullOrEmpty(this.mv_oNguoiKy.mv_TIEUDE) ? sTIEUDE : this.mv_oNguoiKy.mv_TIEUDE;
			sv_fTuyChonKy.mv_sFontName = this.mv_oNguoiKy.mv_FONT_CHU;
			sv_fTuyChonKy.mv_sFontSize = this.mv_oNguoiKy.mv_CO_CHU.ToString();
			sv_fTuyChonKy.mv_sFontStyle = this.mv_oNguoiKy.mv_KIEU_CHU;
			sv_fTuyChonKy.ShowDialog();
			if (sv_fTuyChonKy.mv_bChapNhan) {
				this.mv_oNguoiKy.mv_TEN_BIEUBC = sv_fTuyChonKy.txtBaoCao.Text.Trim();
			    this.mv_oNguoiKy.mv_TIEUDE = sv_fTuyChonKy.txtTieuDe.Text;
				this.mv_oNguoiKy.mv_CO_CHU =Convert.ToInt32( sv_fTuyChonKy.cboFontSize.SelectedItem.ToString());
				//Me.mv_oNguoiKy.mv_CHIEU_DAI = Val(sv_fTuyChonKy.txtDai.Text.Trim)
			    this.mv_oNguoiKy.mv_KIEU_CHU = sv_fTuyChonKy.cboFontStyle.SelectedValue.ToString();
				if (!mv_bAdded) {
					this.mv_oNguoiKy.mv_NOI_DUNG = sv_fTuyChonKy.txtNoiDungKy.Text.Replace(Constants.vbCrLf, "#$X$#") + " ";
				}
				else {
					this.mv_oNguoiKy.mv_NOI_DUNG = sv_fTuyChonKy.txtNoiDungKy.Text.Replace(Constants.vbCrLf, "#$X$#").Substring(0, sv_fTuyChonKy.txtNoiDungKy.Text.Length - 1);
				}
				//Me.mv_oNguoiKy.mv_CHIEU_RONG = Val(sv_fTuyChonKy.txtRong.Text.Trim)
				this.mv_oNguoiKy.mv_FONT_CHU = sv_fTuyChonKy.cboFontName.SelectedItem.ToString();
				//Me.mv_oNguoiKy.mv_TOADO_NGANG = Val(sv_fTuyChonKy.txtViTriX.Text.Trim)
				//Me.mv_oNguoiKy.mv_TOADO_DOC = Val(sv_fTuyChonKy.txtViTriY.Text.Trim)
				if (sv_fTuyChonKy.chkGhiLai.Checked == true) {
					this.mv_oNguoiKy.updateRPTtoDB();
				}
				mv_oNguoiKy.setValueToRPT(ref mv_oRptFieldObj);
				SetParamAgain(mv_oViewDoc.ParameterFieldInfo);
                //mv_oRptDoc.SetParameterValue();
				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 = Nothing
				mv_oViewDoc.ReportSource = RptDoc;
			}
		}
		catch (Exception ex) {
			
		}
	}