public UnitCt(UnitCtType unitType) : base(unitType) { BuildCtService buildService = new BuildCtService(); this.Build = buildService.GetBuild(this.BuildId); }
static void Unit_C2F(UnitCtType unitCtType) { // DateTime begin = DateTime.Now; UnitFwType unitFwType = new UnitFwType(unitCtType); UnitFwService unitFwService = new UnitFwService(); unitFwService.ImportUnit(unitFwType); DateTime end = DateTime.Now; }
public bool ImportUnit(UnitCtType unitCtType) { string funMsg = "function: ImportUnit(UnitCtType unitCtType)" + FileUtility.NewLine + _ClassMsg; try { unitCtType.CreateBy = "System.Console"; int effected = _DbService.ImportUnit(unitCtType); return(effected > 0); } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { this.BuildId = ConvertUtility.Trim(Request.QueryString["id"]); BuildCtService buildService = new BuildCtService(); BuildCt build = buildService.GetBuild(this.BuildId); this.TitleBar = build.ToNavBar(false); UnitCtService unitService = new UnitCtService(); List <string> rows = unitService.ListFloor(this.BuildId); List <string> cols = unitService.ListRoom(this.BuildId); IList <UnitCtType> unit_all = unitService.ListUnit(this.BuildId); this.Rows = rows; this.Columns = cols; this.model = new UnitCtType[rows.Count, cols.Count]; string floor = string.Empty; string room = string.Empty; for (int rowIndex = 0; rowIndex < rows.Count; rowIndex++) { for (int colIndex = 0; colIndex < cols.Count; colIndex++) { floor = rows[rowIndex]; room = cols[colIndex]; UnitCtType unit_floor = unit_all.ToList().Find(m => m.CX_Axis.Equals(room) && m.CY_Axis.Equals(floor)); if (unit_floor != null) { this.model[rowIndex, colIndex] = unit_floor; } } } } } catch (Exception ex) { throw ex; } }
public int ImportUnit(UnitCtType unitCtType) { string funMsg = "function: ImportUnit(UnitCtType unitCtType)" + FileUtility.NewLine + _ClassMsg; try { string procedure = "spImportUnit"; return(DbUtility.ExecuteNonQueryByProc(procedure, this.ConnStr, new SqlParameter[] { new SqlParameter { ParameterName = "@cx_axis", SqlDbType = SqlDbType.NVarChar, Value = unitCtType.CX_Axis }, new SqlParameter { ParameterName = "@cy_axis", SqlDbType = SqlDbType.NVarChar, Value = unitCtType.CY_Axis }, new SqlParameter { ParameterName = "@countf", SqlDbType = SqlDbType.Int, Value = unitCtType.CountF }, new SqlParameter { ParameterName = "@countt", SqlDbType = SqlDbType.Int, Value = unitCtType.CountT }, new SqlParameter { ParameterName = "@countw", SqlDbType = SqlDbType.Int, Value = unitCtType.CountW }, new SqlParameter { ParameterName = "@county", SqlDbType = SqlDbType.Int, Value = unitCtType.CountY }, new SqlParameter { ParameterName = "@area", SqlDbType = SqlDbType.Float, Value = unitCtType.Area }, new SqlParameter { ParameterName = "@directionTo", SqlDbType = SqlDbType.NVarChar, Value = unitCtType.DirectionTo }, new SqlParameter { ParameterName = "@operateStatus", SqlDbType = SqlDbType.Int, Value = unitCtType.Operate }, new SqlParameter { ParameterName = "@agencyCom_UnitId", SqlDbType = SqlDbType.Char, Value = unitCtType.AgencyCom_UnitId }, new SqlParameter { ParameterName = "@agencyCom_BuildId", SqlDbType = SqlDbType.Char, Value = unitCtType.AgencyCom_BuildId }, new SqlParameter { ParameterName = "@agencyCom_CX_Axis", SqlDbType = SqlDbType.NVarChar, Value = unitCtType.AgencyCom_CX_Axis }, new SqlParameter { ParameterName = "@agencyCom_CY_Axis", SqlDbType = SqlDbType.NVarChar, Value = unitCtType.AgencyCom_CY_Axis }, new SqlParameter { ParameterName = "@agencyCom_CountF", SqlDbType = SqlDbType.Int, Value = unitCtType.AgencyCom_CountF }, new SqlParameter { ParameterName = "@agencyCom_CountT", SqlDbType = SqlDbType.Int, Value = unitCtType.AgencyCom_CountT }, new SqlParameter { ParameterName = "@agencyCom_CountW", SqlDbType = SqlDbType.Int, Value = unitCtType.AgencyCom_CountW }, new SqlParameter { ParameterName = "@agencyCom_CountY", SqlDbType = SqlDbType.Int, Value = unitCtType.AgencyCom_CountY }, new SqlParameter { ParameterName = "@agencyCom_Area", SqlDbType = SqlDbType.Float, Value = unitCtType.AgencyCom_Area }, new SqlParameter { ParameterName = "@agencyCom_DirectionTo", SqlDbType = SqlDbType.NVarChar, Value = unitCtType.AgencyCom_DirectionTo }, new SqlParameter { ParameterName = "@createBy", SqlDbType = SqlDbType.NVarChar, Value = unitCtType.CreateBy } })); } catch (Exception ex) { throw ex; } }