CrystalDecisions.Shared.ParameterField GetTrinhky(CrystalDecisions.Shared.ParameterFields p)
        {
            try
            {

                CrystalDecisions.Shared.ParameterFields p0 = new CrystalDecisions.Shared.ParameterFields();
                for (int i = 0; i <= p.Count - 1; i++)
                {
                    if (Utility.DoTrim( p[i].ParameterFieldName.ToUpper()) == "txtTrinhky".ToUpper())
                    {
                        this.Text = this.Text + " Có TK";
                        return p[i];
                    }

                }
                this.Text = this.Text + "- Không có TK";
                return null;
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("GetTrinhky-->" + ex.Message);
                return null;
            }
        }
        void SetTrinhky(CrystalDecisions.Shared.ParameterFields p)
        {
            try
            {
                CrystalDecisions.Shared.ParameterFields p0 = new CrystalDecisions.Shared.ParameterFields();
                for (int i = 0; i <= p.Count - 1; i++)
                {
                    if (p[i].ParameterFieldName.ToUpper() == "txtTrinhky".ToUpper())
                    {
                        if (mv_bSetContent)
                        {
                            string NoidungTK =mv_oNguoiKy.mv_NOI_DUNG;
                            NoidungTK = NoidungTK.Replace("&DIADIEM", Utility.GetRtfUnicodeEscapedString(Utility.Laygiatrithamsohethong("DIA_DIEM", "Địa điểm", false)));
                            NoidungTK = NoidungTK.Replace("&NHANVIEN", Utility.GetRtfUnicodeEscapedString(globalVariables.gv_strTenNhanvien));
                            NoidungTK = NoidungTK.Replace("&NGAYIN", Utility.GetRtfUnicodeEscapedString(Utility.FormatDateTimeWithLocation(globalVariables.SysDate, globalVariables.gv_strDiadiem)));
                            NoidungTK = NoidungTK.Replace("&NGUOIIN", Utility.GetRtfUnicodeEscapedString(globalVariables.gv_strTenNhanvien));
                            NoidungTK = NoidungTK.Replace("&NGAY", Strings.Right("0" + NGAY.Day.ToString(), 2)).Replace("&THANG", Strings.Right("0" + NGAY.Month.ToString(), 2)).Replace("&NAM", NGAY.Year.ToString());
                            RptDoc.SetParameterValue(p[i].ParameterFieldName, NoidungTK);
                        }
                        else
                        {
                            RptDoc.SetParameterValue(p[i].ParameterFieldName,"");
                        }
                        break;
                    }

                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("SetTrinhky-->"+ex.Message);
            }
        }
        void SetTrinhky(CrystalDecisions.Shared.ParameterFields p)
        {
            try
            {
                CrystalDecisions.Shared.ParameterFields p0 = new CrystalDecisions.Shared.ParameterFields();
                for (int i = 0; i <= p.Count - 1; i++)
                {
                    if (p[i].ParameterFieldName.ToUpper() == "txtTrinhky".ToUpper())
                    {
                        if (mv_bSetContent)
                        {
                            RptDoc.SetParameterValue(p[i].ParameterFieldName, mv_oNguoiKy.mv_NOI_DUNG.Replace("&NHANVIEN", globalVariables.gv_strTenNhanvien));
                        }
                        else
                        {
                            RptDoc.SetParameterValue(p[i].ParameterFieldName,"");
                        }
                        break;
                    }

                }
            }
            catch (Exception ex)
            {
            }
        }
        CrystalDecisions.Shared.ParameterField GetTrinhky(CrystalDecisions.Shared.ParameterFields p)
        {
            try
            {
                CrystalDecisions.Shared.ParameterFields p0 = new CrystalDecisions.Shared.ParameterFields();
                for (int i = 0; i <= p.Count - 1; i++)
                {
                    if (p[i].ParameterFieldName.ToUpper() == "txtTrinhky".ToUpper())
                    {
                        return p[i];
                    }

                }
                return null;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Beispiel #5
0
	private void SetParamAgain(CrystalDecisions.Shared.ParameterFields p)
	{
		try {
			CrystalDecisions.Shared.ParameterFields p0 = new CrystalDecisions.Shared.ParameterFields();
			for (int i = 0; i <= p.Count - 1; i++) {
				if (p[i].ParameterFieldName.ToUpper() == "TXTNGUOIKY1") {
					RptDoc.SetParameterValue(p[i].ParameterFieldName, mv_oNguoiKy.mv_NOI_DUNG.Replace("&NHANVIEN", globalVariables.gv_sStaffName));
				}
				else if (p[i].ParameterFieldName.ToUpper() == "TXTNGAYQT") {
				}
				else {
					RptDoc.SetParameterValue(p[i].ParameterFieldName, ((CrystalDecisions.Shared.ParameterDiscreteValue)p[i].CurrentValues[0]).Value);
				}
			}
		}
		catch (Exception ex) {
		}
	}
Beispiel #6
0
 private void FillParams(PLCrystalReportViewer view)
 {
     if (mParameters != null)
     {
         CrystalDecisions.Shared.ParameterFields pars = new CrystalDecisions.Shared.ParameterFields();
         foreach (string varKey in mParameters.Keys)
         {
             object tempValue;
             mParameters.TryGetValue(varKey, out tempValue);
             CrystalDecisions.Shared.ParameterField paramField = new CrystalDecisions.Shared.ParameterField();
             paramField.Name = varKey;
             CrystalDecisions.Shared.ParameterDiscreteValue paramDiscreteValue = new CrystalDecisions.Shared.ParameterDiscreteValue();
             paramDiscreteValue.Value = tempValue;
             paramField.CurrentValues.Add(paramDiscreteValue);
             pars.Add(paramField);
         }
         //view._I.ParameterFieldInfo = pars;//phien bản 12
         view.ParameterFieldInfo = pars;//phien bản 10
     }
 }
        void SetTrinhky(CrystalDecisions.Shared.ParameterFields p)
        {
            try
            {
                CrystalDecisions.Shared.ParameterFields p0 = new CrystalDecisions.Shared.ParameterFields();
                for (int i = 0; i <= p.Count - 1; i++)
                {
                    if (p[i].ParameterFieldName.ToUpper() == "txtTrinhky".ToUpper())
                    {
                        if (mv_bSetContent)
                        {
                            string sPvalue=mv_oNguoiKy.mv_NOI_DUNG.Replace("&NHANVIEN", globalVariables.gv_strTenNhanvien);
                            sPvalue = sPvalue.Replace("&NGAYIN", GetRtfUnicodeEscapedString(Utility.FormatDateTimeWithLocation(globalVariables.SysDate, globalVariables.gv_strDiadiem)));
                            sPvalue = sPvalue.Replace("&NGUOIIN", GetRtfUnicodeEscapedString(globalVariables.gv_strTenNhanvien));
                            RptDoc.SetParameterValue(p[i].ParameterFieldName, sPvalue);
                        }
                        else
                        {
                            RptDoc.SetParameterValue(p[i].ParameterFieldName,"");
                        }
                        break;
                    }

                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg(ex.Message);
            }
        }