public void AddFileCargoEvent() { FileCargo aNewObject = new FileCargo(0, FileCargoName.FindFileCargoName(int.Parse(_ItsView.FileCargoName)), _ItsView.Remark, _ItsView.File, new Account(_ItsView.AccountID, "", "")); _IFileCargoFacade.AddFileCargo(aNewObject); _ItsView.ActionSuccess = true; }
public void InitView() { _ItsView.Title = EmployeePresenterUtilitys._DimissionInfoFileCargoAdd; _ItsView.Id = string.Empty; _ItsView.Remark = string.Empty; _ItsView.FileCargoNameSource = FileCargoName.GetAll(); }
//private FileCargo FindFileCargoById(int id) //{ // if (_ItsView.FileCargoDataSource != null) // { // foreach (FileCargo fc in _ItsView.FileCargoDataSource) // { // if (fc.HashCode.Equals(id)) // { // return fc; // } // } // } // return null; //} public void UpdateFileCargoEvent() { int theId; if (!int.TryParse(_Id, out theId)) { return; } FileCargo theObject = new FileCargo(theId, FileCargoName.FindFileCargoName(int.Parse(_ItsView.FileCargoName)), _ItsView.Remark, _ItsView.File, new Account(_ItsView.AccountID, "", "")); _IFileCargoFacade.UpdateFileCargo(theObject); _ItsView.ActionSuccess = true; }
/// <summary> /// /// </summary> /// <param name="pKID"></param> /// <returns></returns> public FileCargo GetFileCargoByFileCargoID(int pKID) { FileCargo fileCargo = null; SqlCommand cmd = new SqlCommand(); cmd.Parameters.Add(_PKID, SqlDbType.Int).Value = pKID; using (SqlDataReader sdr = SqlHelper.ExecuteReader("GetFileCargoByFileCargoID", cmd)) { while (sdr.Read()) { fileCargo = new FileCargo(Convert.ToInt32(sdr[_DbPKID]), FileCargoName.FindFileCargoName(Convert.ToInt32(sdr[_DbFileCargoName])), sdr[_DbRemark].ToString(), sdr[_DbFile].ToString(), new Account(Convert.ToInt32(sdr[_DbAccountID]), "", "")); } } return(fileCargo); }
public void InitView() { //初始化 _ItsView.Id = string.Empty; _ItsView.Title = EmployeePresenterUtilitys._DimissionInfoFileCargoUpdate; _ItsView.FileCargoNameSource = FileCargoName.GetAll(); //数据绑定 int id; if (!int.TryParse(_Id, out id)) { return; } FileCargo theObject = _IFileCargoFacade.GetFileCargoByFileCargoID(id); if (theObject != null) { _ItsView.Id = theObject.FileCargoID.ToString(); _ItsView.FileCargoName = theObject.Name.Id.ToString(); _ItsView.Remark = theObject.Remark; } }