private void btnSave_Click(object sender, EventArgs e) { try { if (CheckValid() != -1) { int iParm; Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance); //t.BeginTransaction(); bed.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); this.GetBedInfo(); if (isUpdate) { iParm = bed.UpdateBedInfo(BedInfo); } else { iParm = bed.CreatBedInfo(BedInfo); } //{619F3CBF-7954-4d5e-B815-C66987E15C60} ´²Î»Êý¿ØÖÆУÑé if (Components.Manager.Classes.Function.BedVerify() == false) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); return; } if (iParm <= 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack();; MessageBox.Show(this.bed.Err); } else { Neusoft.FrameWork.Management.PublicTrans.Commit();; MessageBox.Show("±£´æ³É¹¦£¡"); DialogResult = DialogResult.OK; this.Close(); } Neusoft.HISFC.BizProcess.Integrate.Function funIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Function(); funIntegrate.SaveChange <Neusoft.HISFC.Models.Base.Bed>("Bed", !this.isUpdate, false, BedInfo.ID, this.originalBed, BedInfo); } else { MessageBox.Show(Err); } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
private void btnSave_Click(object sender, EventArgs e) { try { if (CheckValid() != -1) { int iParm = 0; #region ´¦ÀíÅúÁ¿¼Ó´²²»Ö§³Ö·ÇÊý×Ö×Ö·û {CE0F5F09-987B-49f4-862C-63930084A18A} wbo 20100915 //for (int i = 0; i <= int.Parse(tbCount.Text.Trim()) - 1; i++) //{ // int bedNo; // bedNo = int.Parse(txtBedNo.Text) + i; // this.GetBedInfo(bedNo.ToString()); // //{6A55FE10-D8BA-40da-AFFE-B3020AC26716} // BedInfo.SortID = int.Parse(txtSort.Text) + i; // if (isUpdate) // { // iParm = bed.UpdateBedInfo(BedInfo); // } // else // { // iParm = bed.CreatBedInfo(BedInfo); // } //} string zdSourceBedNO = txtBedNo.Text; //Ôʼ´²ºÅ string zdPreTxt = ""; //ǰ׺ string zdBedNO = ""; //´²Î»±àºÅ zdBedNO = Neusoft.FrameWork.Public.String.TakeOffSpecialChar(zdSourceBedNO); if (zdBedNO.Length != zdSourceBedNO.Length) { MessageBox.Show("°üº¬ÌØÊâ×Ö·û£¬ÇëÖØÐÂÊäÈ룡"); return; } if (zdSourceBedNO.Contains("+")) { zdPreTxt = "+"; zdBedNO = zdBedNO.Substring(1); } else if (zdSourceBedNO.Contains("¼Ó")) { zdPreTxt = "¼Ó"; zdBedNO = zdBedNO.Substring(1); } else { //²»´¦Àí } Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance); bed.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); for (int i = 0; i <= int.Parse(tbCount.Text.Trim()) - 1; i++) { int bedNo; //bedNo = int.Parse(txtBedNo.Text) + i; bedNo = int.Parse(zdBedNO) + i; //this.GetBedInfo(bedNo.ToString()); string newBedNO = zdPreTxt + bedNo.ToString();//д²Î»ºÅµÈÓÚǰ׺+ÐòºÅ this.GetBedInfo(cmbNurse.SelectedItem.ID + newBedNO); //{6A55FE10-D8BA-40da-AFFE-B3020AC26716} BedInfo.SortID = int.Parse(txtSort.Text) + i; if (isUpdate) { iParm = bed.UpdateBedInfo(BedInfo); } else { iParm = bed.CreatBedInfo(BedInfo); } } #endregion //{619F3CBF-7954-4d5e-B815-C66987E15C60} ´²Î»Êý¿ØÖÆУÑé if (Components.Manager.Classes.Function.BedVerify() == false) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); return; } if (iParm <= 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack();; MessageBox.Show(this.bed.Err); } else { Neusoft.FrameWork.Management.PublicTrans.Commit();; MessageBox.Show("±£´æ³É¹¦£¡"); DialogResult = DialogResult.OK; this.Close(); } } else { MessageBox.Show(Err); } } catch (Exception ee) { MessageBox.Show(ee.Message); } }