原创 joe to see see收藏

 | 旧一篇: sqlserver如何在命令行查看服务器版本

看到这段代码发条短信
using System;
using System.Windows.Forms;
using System.Collections;
using System.Reflection;

namespace TestHashTable
{
 /// <summary>
 /// Cache 的摘要说明。
 /// </summary>
 public class Cache
 {
  private static System.Collections.Hashtable ht=new System.Collections.Hashtable();
  private Cache()
  {
   //
   // TODO: 在此处添加构造函数逻辑
   //
  }

  public static System.Windows.Forms.Form GetForm(string formtype)
  {
   if(ht.Contains(formtype))
   {
    
   }
   else
   {
    ht.Add(formtype,System.Activator.CreateInstance(System.Type.GetType(formtype)));
   }
   return ht[formtype] as Form;

  }

  public static Form GenerationForm(string type)
  {
   
   return System.Activator.CreateInstance(System.Type.GetType(type),false) as Form;
  }
 }
}

 

发表于 @ 2007年03月09日 10:11:00|评论(loading...)|编辑

 | 旧一篇: sqlserver如何在命令行查看服务器版本

评论

#xiaoba8246 发表于2007-03-14 15:38:32  IP: 218.17.221.*
本来这样一句就可以弹出窗体:
FormCache.GetForm("com.epcis.autoclaim.ui.frmPeopleInjureView").Show();
但现在这个叫做frmPeopleInjureView的窗体里面有个属性:cateCode,现在在本窗体里想把一个值赋给frmPeopleInjureView的这个属性,又想弹出该窗体,该怎么做呢?我用下面的方法是错误的:
frmPeopleInjureView fpv=FormCache("com.epcis.autoclaim.ui.frmPeopleInjureView");
fpv.CateCode=this.CateCode;
fpv.Show();
提示的错误是FromCache.GetForm()这个方法的返回类型是所有窗体的基类:public static MFForm GetForm(string form)
之后我又把该方法的前面加上(frmPeopleInjureView)可还是报错,你大概知道是怎么回事吗?
#deadshot123 发表于2007-03-14 15:55:44  IP: 218.17.227.*
frmPeopleInjureView fpv=FormCache("com.epcis.autoclaim.ui.frmPeopleInjureView") as frmPeopleInjureView ;
#xiaoba8246 发表于2007-03-14 16:02:54  IP: 218.17.221.*
还是报以下错误:)
************** Exception Text **************
System.MissingMethodException: No parameterless constructor defined for this object.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at com.epcis.autoclaim.util.FormCache.GetForm(String formName) in D:\view\ex_yinyanzhou_view\group_mobile\eMAC\src\CarInsCompensation\CarInsCompensation\com\epcis\autoclaim\util\FormCache.cs:line 24
at com.epcis.autoclaim.ui.frmPeopleInjureList.lvPersonInfo_ItemActivate(Object sender, EventArgs e) in D:\view\ex_yinyanzhou_view\group_mobile\eMAC\src\CarInsCompensation\CarInsCompensation\com\epcis\autoclaim\ui\frmPeopleInjureList.cs:line 117
at System.Windows.Forms.ListView.OnItemActivate(EventArgs e)
at System.Windows.Forms.ListView.WmReflectNotify(Message& m)
at System.Windows.Forms.ListView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(
#deadshot123 发表于2007-03-14 16:05:00  IP: 218.17.227.*
无带参数的构造函数
#xiaoba8246 发表于2007-03-15 13:35:01  IP: 218.17.221.*
现在的这个框架其实就是个窗体隐藏,窗体的一些自定义的私有成员如果经过程序的运行,值可能被改变,但是,下次打开窗体的时候,想恢复这些参数,也即进行一些私有成员的初始化,思路该如何?
#deadshot123 发表于2007-03-15 14:30:44  IP: 218.17.227.*
既然是窗体隐藏 当然私有成员变化的时候,第二次再开是变化后的数

可以再show的时候引发的相关事件进行初始化
#xiaoba8246 发表于2007-03-20 16:01:11  IP: 218.17.221.*
你太有才了!!!!
#xiaoba8246 发表于2007-03-23 10:31:08  IP: 218.17.221.*
virtual方法是不是必须为protected类型啊?
我遇到的问题是:在基类中,有一个protected virtual void Form_Load()方法,我想在另外的地方调用,所以必须把它改成public,可是其他窗体已经继承于该Form_Load()的地方会报错
#xiaoba8246 发表于2007-03-23 10:39:01  IP: 218.17.221.*
当继承于该窗体的时候,Form_Load()的访问类型必须和基类的一样是吧?如果要是protected全是protected,要是public都是public?好象是这样:)
#deadshot123 发表于2007-03-23 10:40:09  IP: 218.17.227.*
protected仅仅是控制使用范围,可见性
virtual标识它是可重写的

两者不应该有冲突 而且你为什么要改为public?

报错?报什么错?
#xiaoba8246 发表于2007-03-23 10:47:08  IP: 218.17.221.*
就昨天说的问题塞,但是这边没有Visible那个事件,所以我想在
private static void form_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
MFForm mfFrom = sender as MFForm;
mfFrom.Hide();
mfFrom.Form_Load(sender,e);//这里调用基窗
//体MFForm的protected virtual void Form_Load()方法,所
//以,必须把它改成public
e.Cancel = true;
}

也就是说我这个环境下没有你昨天晚上说的那个窗体Show时的触发事件,所以我想在你写的这个窗体隐藏时调用初始化方法Form_Load(),明白我的意思吗?:)
#deadshot123 发表于2007-03-23 10:51:30  IP: 218.17.227.*
public class BaseForm:Form
{

protected virtual void Form_Load()
{
}

//你又不说报什么错误,faint;
//可以在基类添加这样一个wrapper方法
public void FormLoad()
{
this.Form_Load();
}
}

调用的时候使用Instance.FormLoad();
#xiaoba8246 发表于2007-03-23 10:57:36  IP: 218.17.221.*
基窗体中的方法是这样
protected void virtual Form_Load(object sender,Args e)
在调用的时候,是这样
protected void overrider Form_Load(object sender,Args e)
我刚才把基窗体的protected改成public时出错了,出错之后,我把调用窗口的protectd也改成public了,就可以了。
报的错是:
Error 1 'com.epcis.autoclaim.ui.frmCarInsCom.Form_Load(object, System.EventArgs)': cannot change access modifiers when overriding 'public' inherited member 'com.epcis.autoclaim.ui.MFForm.Form_Load(object, System.EventArgs)' D:\view\ex_yinyanzhou_view\group_mobile\eMAC\src\CarInsCompensation\CarInsCompensation\com\epcis\autoclaim\ui\frmCarInsCom.cs 57 33 CarInsCompensation
#deadshot123 发表于2007-03-23 10:59:09  IP: 218.17.227.*
按我前面说的做 如果改protected为public 子类也必须用public修饰
#xiaoba8246 发表于2007-03-23 11:00:27  IP: 218.17.221.*
我把基窗体和继承窗体的Form_Load()都写成public就没错了。
#xiaoba8246 发表于2007-03-23 11:43:14  IP: 218.17.221.*
public virtual void Form_Load(object sender, EventArgs e)

我调用这个方法是,既没有sender也没有e,怎么调用啊?
#xiaoba8246 发表于2007-03-23 17:37:13  IP: 218.17.221.*
namespace com.epcis.autoclaim.ui
{
public delegate bool ListFilter(object row);
public class MFForm : Form
{
public MFForm()
: base()
{
AddEvents();
}

/// <summary>
/// 该Form的DTO与控件的匹配表
/// key=control
/// value = dto的属性值(string)。
/// </summary>
protected Hashtable _MatchTable;
protected ArrayList _EnableControl;
protected ValidateExecutor validateExecutor = new ValidateExecutor();
private RegiesterControls _RegisterControls;

/// <summary>
/// 初始化_MatchTable
/// </summary>
protected virtual void InitMatchTable()
{
}

/// <summary>
/// 初始化控件的可选择项目
/// </summary>
protected virtual void InitControls()
{
this.Text = FormTitle;
}

/// <summary>
/// 装载数据,继承的窗体通过覆盖这个方法获得需要的DTO。
/// 需要修改DataDTO属性
/// </summary>
/// <exception cref="MFLoadDataException"></exception>
protected virtual void LoadData()
{
}

/// <summary>
/// 窗体的标题
/// </summary>
prot
#xiaoba8246 发表于2007-03-23 17:37:58  IP: 218.17.221.*
namespace com.epcis.autoclaim.ui
{
public partial class frmPeopleInjureList : MFForm
{
public frmPeopleInjureList()
{
InitializeComponent();
}

private PDASurveyDetail _personDTO = null;
public PDASurveyDetail PersonDTO
{
get { return _personDTO; }
set { _personDTO = value; }
}

protected override string FormTitle
{
get
{
return "人伤列表";
}
}

protected override void LoadData()
{
MessageBox.Show("loaddata");
if (Case.PDASurveyDetail != null && Case.PDASurveyDetail.PDADamagePersonSubTotals != null)
{
MessageBox.Show(Case.CurrentCase.CaseID.ToString());
_personDTO = Case.PDASurveyDetail;
}
else
{
MessageBox.Show("sldjfsidjfos");
_personDTO = new PDASurveyDetail();
_personDTO.PDADamagePersonSubTotals = new PDADamagePersonSubTotal[] { new PDADamagePersonSubTotal() };
}
}

public override void Form_Load(object sender, EventArgs e)
{
base.Form_Load(sender, e);
MessageB
#xiaoba8246 发表于2007-03-23 17:39:56  IP: 218.17.221.*
ox.Show("hello");
MenuItemsStatus();
}

protected override void InitMatchTable()
{
_MatchTable = new Hashtable();

Hashtable ht1 = new Hashtable();
ht1.Add(HashKey.ListType, ListType.SimpleListView);
ht1.Add(HashKey.ListDataSource, "PersonDTO.PDADamagePersonSubTotals");
ht1.Add(0, "cateName");
ht1.Add(1, "paySubTotal");
ht1.Add(2, "injuredNum");
ht1.Add(3, "cateCode");

_MatchTable.Add(this.lvPersonInfo, ht1);
}
//客运承运
private void menuItem7_Click(object sender, EventArgs e)
{
//frmPeopleInjureClient fpc = new frmPeopleInjureClient();
//fpc.Show();
FormCache.GetForm("com.epcis.autoclaim.ui.frmPeopleInjureClient").Show();
}

//MenuItems状态判断
private void MenuItemsStatus()
{
this.menuItem3.Enabled = false;
this.menuItem4.Enabled = false;
this.menuItem5.Enabled = false;
this.menuItem6.Enabled = false;
this.menuItem7.Enabled = false;

for (int i = 0; i < Case.PDASurveyDetail.PDAPolicyRelations.Length; i++)
{
for (int j = 0; j < Case.PDASurveyDetail.PDAPolicyRelati
#xiaoba8246 发表于2007-03-23 17:40:16  IP: 218.17.221.*
for (int i = 0; i < Case.PDASurveyDetail.PDAPolicyRelations.Length; i++)
{
for (int j = 0; j < Case.PDASurveyDetail.PDAPolicyRelations[i].PDAPolicyFees.Length; j++)
{
switch (Case.PDASurveyDetail.PDAPolicyRelations[i].PDAPolicyFees[j].cateCode)
{
case "04"://司机座位险
this.menuItem3.Enabled = true;
break;
case "29":// 交通事故精神损失险
this.menuItem6.Enabled = true;
break;
case "05":
case "051":// 前排乘客
case "052":// 后排乘客
this.menuItem4.Enabled = true;
break;
case "02":// 三者人伤
this.menuItem5.Enabled = true;
break;
case "32"://承运人
this.menuItem7.Enabled = true;
break;
default:
break;
}
}
}
#xiaoba8246 发表于2007-03-23 17:41:11  IP: 218.17.221.*
/// <summary>
/// 窗体的标题
/// </summary>
protected virtual string FormTitle
{
get { return ""; }
}

/// <summary>
/// 增加事件。
/// </summary>
protected virtual void AddEvents()
{
this.Load += new System.EventHandler(this.Form_Load);
//this.Validating += new System.ComponentModel.CancelEventHandler(this.Form_Validating);
}

protected void PutValidateTarget(Control control,Hashtable hastTable)
{
validateExecutor.putValidateTarget(ValidateDataMap.registe(control, hastTable));
}

/// <summary>
/// 启动窗体
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public virtual void Form_Load(object sender, EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
// 初始化 字段--DTO属性的匹配表。
InitMatchTable();

try
{
LoadData();
}
catch (MFLoadDataException mlde)
{
MessageBox.Show(mlde.Message, "无法获取数据");
this.Close();
Cursor.Current = Cursors.Default;<
#xiaoba8246 发表于2007-03-23 17:41:57  IP: 218.17.221.*
return;
}

_RegisterControls = new RegiesterControls(this, _MatchTable, _EnableControl);//,_FormatTable);
_RegisterControls.Init();

// 初始化所有控件。
InitControls();

// 填充该Form的所有数据。
_RegisterControls.Fill();
Cursor.Current = Cursors.Default;
}

protected virtual void ReflashControl(Control control)
{
_RegisterControls.ReflashControl(control);
}

protected virtual bool Form_Validating()
{
//this.validateExecutor.doValidate();
ValidateResult result = this.validateExecutor.doValidate();
if (result.Messages != null && result.Messages.Keys.Count > 0)
{
return false;
}
else
{
return true;
}
}

protected virtual void SaveData()
{
_RegisterControls.Save();
}
#xiaoba8246 发表于2007-03-23 17:45:43  IP: 218.17.221.*
/// <summary>
/// 人伤按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPeopleInjure_Click(object sender, EventArgs e)
{
MessageBox.Show(Case.CurrentCase.CaseID.ToString());
frmPeopleInjureList fpi = FormCache.GetForm("com.epcis.autoclaim.ui.frmPeopleInjureList") as frmPeopleInjureList;
fpi.PersonDTO = Case.PDASurveyDetail;
fpi.Show();
//frmPeopleInjureList fpi = new frmPeopleInjureList();
//fpi.Show();
}
#xiaoba8246 发表于2007-03-26 09:36:53  IP: 218.17.221.*
按照你说的,把那个Form_Load(object sender,EventArgs e)中的两个参数去掉为什么会报:
No overload for 'Form_Load' matches delegate 'System.EventHandler'?

protected virtual void AddEvents()
{
this.Load += new System.EventHandler(this.Form_Load);
}

public virtual void Form_Load()//object sender, EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
// 初始化 字段--DTO属性的匹配表。
InitMatchTable();

try
{
LoadData();
}
catch (MFLoadDataException mlde)
{
MessageBox.Show(mlde.Message, "无法获取数据");
this.Close();
Cursor.Current = Cursors.Default;
return;
}

_RegisterControls = new RegiesterControls(this, _MatchTable, _EnableControl);//,_FormatTable);
_RegisterControls.Init();

// 初始化所有控件。
InitControls();

// 填充该Form的所有数据。
_RegisterControls.Fill();
Cursor.Current = Cursors.Default;
}
#deadshot123 发表于2007-03-26 10:36:27  IP: 218.17.227.*
基类去掉了 子类当然也要去掉撒
#xiaoba8246 发表于2007-03-26 10:45:37  IP: 218.17.221.*
不对吧
EventHandler是一个委托声明如下(其在.Net类库中如下声明的)

public delegate void EventHandler( object sender , EventArgs e )所以,所有形如:
void 函娄名(object 参数名,EventArgs 参数名);
的函数都可以作为Control类的Click事件响应方法了。如下面所定义的一个事件响应方法:
private void button1_Click(object sender, System.EventArgs e)

参数object sender表示引发事件的对象,(其实这里传递的是对象的引用,如果是button1的click事件则sender就是button1)System.EventArgs e 代表事件的相应信息,如鼠标的x,y值等。

也就是说,System.EventHandler(this.Form_Load);
这里的Form_Load()里必须有两个参数吧

#xiaoba8246 发表于2007-03-26 10:46:18  IP: 218.17.221.*
不知道我说错了没?
#xiaoba8246 发表于2007-03-26 11:12:13  IP: 218.17.221.*
my problem has been resolved,thks
#deadshot123 发表于2007-03-26 11:40:07  IP: 218.17.227.*
please don't say english ,i don't understand.xiexie
#xiaoba8246 发表于2007-03-26 11:56:40  IP: 218.17.221.*
FUCK U !
U R SHIT!
#xiaoba8246 发表于2007-03-29 17:15:45  IP: 218.17.221.*
int l = 0, k = 0;
_fosterDTO = new PDAPersonFee[_detailsDTO.pdaPersonBaseInfo.personFeeArray.Length];
_tenderDTO = new PDAPersonFee[_detailsDTO.pdaPersonBaseInfo.personFeeArray.Length];
for (int j = 0; j < _detailsDTO.pdaPersonBaseInfo.personFeeArray.Length; j++)
{
if (_detailsDTO.pdaPersonBaseInfo.personFeeArray[j].feeType == "1")
{
_fosterDTO[l] = _detailsDTO.pdaPersonBaseInfo.personFeeArray[j];
l++;
}
else
{
_tenderDTO[k] = _detailsDTO.pdaPersonBaseInfo.personFeeArray[j];
k++;
}
}
#xiaoba8246 发表于2007-03-29 17:17:54  IP: 218.17.221.*
_fosterDTO = new PDAPersonFee[_detailsDTO.pdaPersonBaseInfo.personFeeArray.Length];
_tenderDTO = new PDAPersonFee[_detailsDTO.pdaPersonBaseInfo.personFeeArray.Length];
我想让这两个数组的长度根据(_detailsDTO.pdaPersonBaseInfo.personFeeArray[j].feeType == "1")中的feeType数量多少做动态的初始化,怎么搞?:)
#xiaoba8246 发表于2007-03-29 17:19:58  IP: 218.17.221.*
也就是说
_detailsDTO.pdaPersonBaseInfo.personFeeArray[j].feeType中的feeType有两个类型,一个为“1”,另一个为其他,我怎么反过来根据他们的数量动态地创建_fosterDTO = new PDAPersonFee[_detailsDTO.pdaPersonBaseInfo.personFeeArray.Length];
_tenderDTO = new PDAPersonFee[_detailsDTO.pdaPersonBaseInfo.personFeeArray.Length];
这两个数组,而不是全长
#xiaoba8246 发表于2007-03-30 13:47:51  IP: 218.17.221.*
public static MFForm GetForm(string formName)
{
if (formHT.Contains(formName))
{
//form = formHT[formName] as MFForm;
//form.Form_Load(null, null);
}
else
{
Type type = System.Type.GetType(formName);
MFForm form = System.Activator.CreateInstance(type) as MFForm;
form.Closing += new System.ComponentModel.CancelEventHandler(form_Closing);
formHT.Add(formName, form);
}
MFForm tempForm = formHT[formName] as MFForm;
return tempForm;
}

我把Form_Load()函数放在调用的时候,即:
frmPeopleInjureThird fpt = FormCache.GetForm("com.epcis.autoclaim.ui.frmPeopleInjureThird") as frmPeopleInjureThird;
fpt.Form_Load(sender, e);
fpt.Show();
出现这种情况:也就是说当一个窗体第一次new 的时候,这个窗体将会执行两次初始化,明白我的意思吗?
#everythingudo 发表于2007-03-30 13:51:50  IP: 218.17.227.*
是要两次,第二次就不用了 ,这也只是针对你要的那种情况
#xiaoba8246 发表于2007-03-30 14:05:30  IP: 218.17.221.*
你觉得有办法解决这个矛盾不?
#xiaoba8246 发表于2007-03-30 14:13:25  IP: 218.17.221.*
我是这样想的,我在FormCache里加一个属性,比如叫Flag,为布尔类型的,一开始的时候值为false。当该窗体被new之后,该值被改变,为true,然后在调用的时候做一个判断,你觉得可行吗?:)
#everythingudo 发表于2007-03-30 15:00:19  IP: 218.17.227.*
可以,除非你这种情况很多并且初始化很耗时间 要不没有必要
#xiaoba8246 发表于2007-03-30 15:11:42  IP: 218.17.221.*
情况非常之多,非常之耗时:)
我已经这么做了,好象是可行的
#xiaoba8246 发表于2007-04-05 17:20:48  IP: 218.17.221.*
private void btnSearch_Click(object sender, EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;

this.btnSearch.Visible = false;

this.cboBrand.DropDownStyle = ComboBoxStyle.DropDownList;
//this.cboBrand.Text = "请选择";

this.cboBrand.Size = new Size(145, 22);
this.cboProducingArea.Size = new Size(145, 22);
this.cboSeriesName.Size = new Size(145, 22);
this.cboGroupName.Size = new Size(145, 22);
this.cboType.Size = new Size(145, 22);

this.FillComboBox("2");
this.cboBrand.Enabled = true;

Cursor.Current = Cursors.Default;
}
#xiaoba8246 发表于2007-04-05 17:21:35  IP: 218.17.221.*
private void FillComboBox(string flag)
{
/*flag= 1(厂家) 2(品牌) 3(车型) 5(车系) 6(车组) */
string _flag, _brand, _producingArea, _seriesName, _groupName, _type, _vehicleId;
_flag = flag;

if (cboBrand.Text == "请选择品牌")
{
_brand = "";
}
else
{
_brand = cboBrand.Text;
MessageBox.Show(cboBrand.Text);

PDAVehicleResponse pdaReq = BackService.GetVehicleAllByCondition(_flag, _brand, _producingArea, _seriesName, _groupName, _type, _vehicleId);

if (pdaReq == null || pdaReq.pdaVehicles == null)
{
return;
}
else
{
_pdaVehicls = pdaReq.pdaVehicles;
}

switch (_flag)
{
case "2":
//this.cboBrand.Items.Clear();
//this.cboBrand.Items.Add("请选择品牌");
this.cboBrand.SelectedIndex = 0;
foreach (PDAVehicle pv in _pdaVehicls)
{
if (pv.brand != null)
{
this.cboBrand.Items.Add(pv.brand);
}
}
#xiaoba8246 发表于2007-04-13 15:58:01  IP: 218.17.221.*
c#中,如果结果是5.4 ,只要是大于5,小于6的都等于6,有这个的专门函数吗?
#deadshot123 发表于2007-04-13 16:35:07  IP: 218.17.227.*
自己写一个方法
#xiaoba8246 发表于2007-04-18 16:38:24  IP: 218.17.221.*
ArrayList alFoster = new ArrayList();
ArrayList alTender = new ArrayList();
foreach (PDAPersonFee personFee in _thirdDTO.pdaPersonBaseInfo.personFeeArray)
{
if (personFee.feeType == "1")
{
alFoster.Add(personFee);
}
else
{
alTender.Add(personFee);
}
}
if (alFoster.Count > 0)
{
_fosterDTO = new PDAPersonFee[alFoster.Count];
for (int i = 0; i < alFoster.Count; i++)
{
_fosterDTO[i] = (PDAPersonFee)alFoster[i];
}
}
if (alTender.Count > 0)
{
_tenderDTO = new PDAPersonFee[alTender.Count];
for (int i = 0; i < alTender.Count; i++)
{
_tenderDTO[i] = (PDAPersonFee)alTender[i];
}
}
#xiaoba8246 发表于2007-04-18 16:44:52  IP: 218.17.221.*
/// <summary>
/// 抚养人DTO
/// </summary>
private PDAPersonFee[] _fosterDTO = null;
public PDAPersonFee[] FosterDTO
{
set { _fosterDTO = value; }
get { return _fosterDTO; }
}

//护理人DTO
private PDAPersonFee[] _tenderDTO = null;
public PDAPersonFee[] TenderDTO
{
set { _fosterDTO = value; }
get { return _fosterDTO; }
}
#xiaoba8246 发表于2007-04-18 17:15:37  IP: 218.17.221.*
对搜索引擎熟悉不?
#deadshot123 发表于2007-04-18 17:19:42  IP: 218.17.227.*
不熟
#xiaoba8246 发表于2007-04-18 17:23:06  IP: 218.17.221.*
没玩过?
#deadshot123 发表于2007-04-18 17:40:52  IP: 218.17.227.*
是索
#xiaoba8246 发表于2007-04-27 11:09:20  IP: 218.17.221.*
private void ShowDifForm()
{
switch (User.CateCode)
{
case "04"://司机座位险
Cursor.Current = Cursors.WaitCursor;
frmPeopleInjureDriver fpd = FormCache.GetForm("com.epcis.autoclaim.ui.frmPeopleInjureDriver") as frmPeopleInjureDriver;
fpd.DriverDTO = User.GetInjuredPDetails();
fpd.Title = "编辑司机人伤";
if (FormCache.Flag)
{
fpd.Form_Load(null, null);
}
fpd.Show();
Cursor.Current = Cursors.Default;
break;
case "29":// 交通事故精神损失险
Cursor.Current = Cursors.WaitCursor;
frmPeopleInjureSpirit fps = FormCache.GetForm("com.epcis.autoclaim.ui.frmPeopleInjureSpirit") as frmPeopleInjureSpirit;
fps.SpiritDTO = User.GetInjuredPDetails();
fps.Title = "编辑精神损害赔偿险";
if (FormCache.Flag)
{
fps.Form_Load(null, null);
}
fps.Show();
Cursor.Current = Cursors.Default;
break;
default:
break;
}
#xiaoba8246 发表于2007-04-27 11:12:04  IP: 218.17.221.*
我写了这样的方法,现在我要在不同的地方调用,但只有两个地方不同,第一个:fpd.DriverDTO = User.GetInjuredPDetails();
这里的 User.GetInjuredPDetails()想在另外的地方换成Null,另一个:把“编辑”两个字换成“新增”,我该怎样修改,或者增加这个方法的参数,以达到我想要实现的目的
#deadshot123 发表于2007-04-27 13:42:44  IP: 218.17.227.*
private void ShowDifForm()
(DriverDTO dto)
{
fpd.DriverDTO = dto;
}
发表评论  


当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
Csdn Blog version 3.1a
Copyright © deadshot123