Example #1
0
		private void gridHistory_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			Etrans et=Etranss.GetEtrans(PIn.Long(tableHistory.Rows[e.Row]["EtransNum"].ToString()));
			if(et.Etype==EtransType.StatusNotify_277) {
				FormEtrans277Edit Form277=new FormEtrans277Edit();
				Form277.EtransCur=et;
				Form277.ShowDialog();
				return;//No refresh needed because 277s are not editable, they are read only.
			}
			if(et.Etype==EtransType.ERA_835) {
				string messageText835=EtransMessageTexts.GetMessageText(et.EtransMessageTextNum);
				X12object x835=new X12object(messageText835);
				List<string> listTranSetIds=x835.GetTranSetIds();
				if(et.TranSetId835=="" && listTranSetIds.Count>=2) {
					FormEtrans835PickEob formPickEob=new FormEtrans835PickEob(listTranSetIds,messageText835,et);
					formPickEob.ShowDialog();
				}
				else {//Only one EOB in the 835.
					FormEtrans835Edit Form835=new FormEtrans835Edit();
					Form835.EtransCur=et;
					Form835.MessageText835=messageText835;
					Form835.TranSetId835="";//Empty string will cause the first EOB in the 835 to display.
					Form835.ShowDialog();
				}
			}
			else {
				FormEtransEdit FormE=new FormEtransEdit();
				FormE.EtransCur=et;
				FormE.ShowDialog();
				if(FormE.DialogResult!=DialogResult.OK) {
					return;
				}
			}
			int scroll=gridHistory.ScrollValue;
			FillHistory();
			for(int i=0;i<tableHistory.Rows.Count;i++){
				if(tableHistory.Rows[i]["EtransNum"].ToString()==et.EtransNum.ToString()){
					gridHistory.SetSelected(i,true);
				}
			}
			gridHistory.ScrollValue=scroll;
		}