public bool InsertComparedUnit(UnitCmType obj, UnitFwType m, int comparedStatus) { string funMsg = "function: InsertComparedUnit(UnitCmType obj, UnitFwType m, int comparedStatus)" + FileUtility.NewLine + _ClassMsg; try { if (obj == null) { obj = new UnitCmType(); obj.UnitId = string.Empty; obj.BuildId = string.Empty; obj.CX_Axis = string.Empty; obj.CY_Axis = string.Empty; obj.DirectionTo = string.Empty; } if (m == null) { m = new UnitFwType(); m.UnitId = string.Empty; m.BuildId = string.Empty; m.CX_Axis = string.Empty; m.CY_Axis = string.Empty; m.DirectionTo = string.Empty; } int effected = _DbService.InsertComparedUnit(obj, m, comparedStatus); return(effected > 0); } catch (Exception ex) { throw ex; } }
public UnitFw(UnitFwType unitType) : base(unitType) { BuildFwService buildService = new BuildFwService(); 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(UnitFwType unitFwType) { string funMsg = "function: ImportUnit(UnitFwType unitFwType)" + FileUtility.NewLine + _ClassMsg; try { unitFwType.CreateBy = "System.Console"; int effected = base.ImportUnit(unitFwType); 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"]); BuildFwService buildService = new BuildFwService(); BuildFw build = buildService.GetBuild(this.BuildId); this.TitleBar = build.ToNavBar(false); UnitFwService unitService = new UnitFwService(); List <string> rows = unitService.ListFloor(this.BuildId); List <string> cols = unitService.ListRoom(this.BuildId); IList <UnitFwType> unit_all = unitService.ListUnit(this.BuildId); this.Rows = rows; this.Columns = cols; this.model = new UnitFwType[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]; UnitFwType 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(UnitFwType unitFwType) { string funMsg = "function: ImportUnit(UnitFwType unitFwType)" + FileUtility.NewLine + _ClassMsg; try { string procedure = "spImportUnit"; return(DbUtility.ExecuteNonQueryByProc(procedure, this.ConnStr, new SqlParameter[] { new SqlParameter { ParameterName = "@cx_axis", SqlDbType = SqlDbType.NVarChar, Value = unitFwType.CX_Axis }, new SqlParameter { ParameterName = "@cy_axis", SqlDbType = SqlDbType.NVarChar, Value = unitFwType.CY_Axis }, new SqlParameter { ParameterName = "@countf", SqlDbType = SqlDbType.Int, Value = unitFwType.CountF }, new SqlParameter { ParameterName = "@countt", SqlDbType = SqlDbType.Int, Value = unitFwType.CountT }, new SqlParameter { ParameterName = "@countw", SqlDbType = SqlDbType.Int, Value = unitFwType.CountW }, new SqlParameter { ParameterName = "@county", SqlDbType = SqlDbType.Int, Value = unitFwType.CountY }, new SqlParameter { ParameterName = "@area", SqlDbType = SqlDbType.Float, Value = unitFwType.Area }, new SqlParameter { ParameterName = "@directionTo", SqlDbType = SqlDbType.NVarChar, Value = unitFwType.DirectionTo }, new SqlParameter { ParameterName = "@operateStatus", SqlDbType = SqlDbType.Int, Value = unitFwType.Operate }, new SqlParameter { ParameterName = "@collect_UnitId", SqlDbType = SqlDbType.Char, Value = unitFwType.Collect_UnitId }, new SqlParameter { ParameterName = "@collect_BuildId", SqlDbType = SqlDbType.Char, Value = unitFwType.Collect_BuildId }, new SqlParameter { ParameterName = "@collect_CX_Axis", SqlDbType = SqlDbType.NVarChar, Value = unitFwType.Collect_CX_Axis }, new SqlParameter { ParameterName = "@collect_CY_Axis", SqlDbType = SqlDbType.NVarChar, Value = unitFwType.Collect_CY_Axis }, new SqlParameter { ParameterName = "@collect_CountF", SqlDbType = SqlDbType.Int, Value = unitFwType.Collect_CountF }, new SqlParameter { ParameterName = "@collect_CountT", SqlDbType = SqlDbType.Int, Value = unitFwType.Collect_CountT }, new SqlParameter { ParameterName = "@collect_CountW", SqlDbType = SqlDbType.Int, Value = unitFwType.Collect_CountW }, new SqlParameter { ParameterName = "@collect_CountY", SqlDbType = SqlDbType.Int, Value = unitFwType.Collect_CountY }, new SqlParameter { ParameterName = "@collect_Area", SqlDbType = SqlDbType.Float, Value = unitFwType.Collect_Area }, new SqlParameter { ParameterName = "@collect_DirectionTo", SqlDbType = SqlDbType.NVarChar, Value = unitFwType.Collect_DirectionTo }, new SqlParameter { ParameterName = "@agencyCom_UnitId", SqlDbType = SqlDbType.Char, Value = unitFwType.AgencyCom_UnitId }, new SqlParameter { ParameterName = "@agencyCom_BuildId", SqlDbType = SqlDbType.Char, Value = unitFwType.AgencyCom_BuildId }, new SqlParameter { ParameterName = "@agencyCom_CX_Axis", SqlDbType = SqlDbType.NVarChar, Value = unitFwType.AgencyCom_CX_Axis }, new SqlParameter { ParameterName = "@agencyCom_CY_Axis", SqlDbType = SqlDbType.NVarChar, Value = unitFwType.AgencyCom_CY_Axis }, new SqlParameter { ParameterName = "@agencyCom_CountF", SqlDbType = SqlDbType.Int, Value = unitFwType.AgencyCom_CountF }, new SqlParameter { ParameterName = "@agencyCom_CountT", SqlDbType = SqlDbType.Int, Value = unitFwType.AgencyCom_CountT }, new SqlParameter { ParameterName = "@agencyCom_CountW", SqlDbType = SqlDbType.Int, Value = unitFwType.AgencyCom_CountW }, new SqlParameter { ParameterName = "@agencyCom_CountY", SqlDbType = SqlDbType.Int, Value = unitFwType.AgencyCom_CountY }, new SqlParameter { ParameterName = "@agencyCom_Area", SqlDbType = SqlDbType.Float, Value = unitFwType.AgencyCom_Area }, new SqlParameter { ParameterName = "@agencyCom_DirectionTo", SqlDbType = SqlDbType.NVarChar, Value = unitFwType.AgencyCom_DirectionTo }, new SqlParameter { ParameterName = "@createBy", SqlDbType = SqlDbType.Char, Value = unitFwType.CreateBy }, })); } catch (Exception ex) { throw ex; } }
public UnitFw GetUnit(string unitId) { UnitFwType unitType = GetUnitType(unitId); return(new UnitFw(unitType)); }
public int InsertComparedUnit(UnitCmType obj, UnitFwType m, int comparedStatus) { string funMsg = "function: InsertComparedUnit(UnitCmType obj, UnitFwType m, int comparedStatus)" + FileUtility.NewLine + _ClassMsg; try { string procedure = "spInsertComparedUnit"; return(DbUtility.ExecuteNonQueryByProc(procedure, this.ConnStr, new SqlParameter[] { new SqlParameter { ParameterName = "@unitId", SqlDbType = SqlDbType.VarChar, Value = obj.UnitId }, new SqlParameter { ParameterName = "@buildId", SqlDbType = SqlDbType.VarChar, Value = obj.BuildId }, new SqlParameter { ParameterName = "@cx_axis", SqlDbType = SqlDbType.NVarChar, Value = obj.CX_Axis }, new SqlParameter { ParameterName = "@cy_axis", SqlDbType = SqlDbType.NVarChar, Value = obj.CY_Axis }, new SqlParameter { ParameterName = "@countf", SqlDbType = SqlDbType.Int, Value = obj.CountF }, new SqlParameter { ParameterName = "@countt", SqlDbType = SqlDbType.Int, Value = obj.CountT }, new SqlParameter { ParameterName = "@countw", SqlDbType = SqlDbType.Int, Value = obj.CountW }, new SqlParameter { ParameterName = "@county", SqlDbType = SqlDbType.Int, Value = obj.CountY }, new SqlParameter { ParameterName = "@area", SqlDbType = SqlDbType.VarChar, Value = obj.Area }, new SqlParameter { ParameterName = "@directionTo", SqlDbType = SqlDbType.VarChar, Value = obj.DirectionTo }, new SqlParameter { ParameterName = "@framework_UnitId", SqlDbType = SqlDbType.Char, Value = m.UnitId }, new SqlParameter { ParameterName = "@framework_BuildId", SqlDbType = SqlDbType.Char, Value = m.BuildId }, new SqlParameter { ParameterName = "@framework_CX_Axis", SqlDbType = SqlDbType.NVarChar, Value = m.CX_Axis }, new SqlParameter { ParameterName = "@framework_CY_Axis", SqlDbType = SqlDbType.NVarChar, Value = m.CY_Axis }, new SqlParameter { ParameterName = "@framework_CountF", SqlDbType = SqlDbType.Int, Value = m.CountF }, new SqlParameter { ParameterName = "@framework_CountT", SqlDbType = SqlDbType.Int, Value = m.CountT }, new SqlParameter { ParameterName = "@framework_CountW", SqlDbType = SqlDbType.Int, Value = m.CountW }, new SqlParameter { ParameterName = "@framework_CountY", SqlDbType = SqlDbType.Int, Value = m.CountY }, new SqlParameter { ParameterName = "@framework_Area", SqlDbType = SqlDbType.Float, Value = m.Area }, new SqlParameter { ParameterName = "@framework_DirectionTo", SqlDbType = SqlDbType.NVarChar, Value = m.DirectionTo }, new SqlParameter { ParameterName = "@statusId", SqlDbType = SqlDbType.Int, Value = comparedStatus } })); } catch (Exception ex) { throw ex; } }