Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string httpMethod = Request.HttpMethod;
                string buildId    = ConvertUtility.Trim(Request.QueryString["id"]);

                if (httpMethod.Equals("get", StringComparison.OrdinalIgnoreCase))
                {
                    BuildCtService buildService = new BuildCtService();
                    this.model = buildService.GetBuild(buildId);
                }
                else
                {
                    string x_axis = ConvertUtility.Trim(Request.Form["x_axis"]);
                    string y_axis = ConvertUtility.Trim(Request.Form["y_axis"]);

                    UnitCtService unitService = new UnitCtService();
                    if (unitService.AddUnit(buildId, x_axis, y_axis, this.UserInfo.UserId))
                    {
                        Response.Write("true");
                    }
                    else
                    {
                        Response.Write("false");
                    }

                    Response.End();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string httpMethod = Request.HttpMethod;
                string estateId   = ConvertUtility.Trim(Request.QueryString["id"]);

                if (httpMethod.Equals("get", StringComparison.OrdinalIgnoreCase))
                {
                    EstateCmService estateService = new EstateCmService();
                    this.Estate = estateService.GetEstateById(estateId);
                }
                else
                {
                    //AddData
                    string buildName = ConvertUtility.Trim(Request.Form["buildName"]);

                    BuildCtService buildService = new BuildCtService();

                    if (buildService.AddBuild(estateId, buildName, this.UserInfo.UserId))
                    {
                        Response.Write("true");
                    }
                    else
                    {
                        Response.Write("false");
                    }
                    Response.End();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string        httpMehtod  = Request.HttpMethod;
                UnitCtService unitService = new UnitCtService();
                if (httpMehtod.Equals("get", StringComparison.OrdinalIgnoreCase))
                {
                    this.UnitId = ConvertUtility.Trim(Request.QueryString["id"]);
                    string[] unitIdCollection = this.UnitId.Split(new string[] { AppSettings.FirstSplit }, StringSplitOptions.RemoveEmptyEntries);

                    if (unitIdCollection != null && unitIdCollection.Length > 0)
                    {
                        List <string>  unit         = new List <string>();
                        BuildCtService buildService = new BuildCtService();
                        foreach (var item in unitIdCollection)
                        {
                            var centaUnit = unitService.GetUnit("");
                            unit.Add(centaUnit.CY_Axis + centaUnit.CX_Axis);
                            if (string.IsNullOrEmpty(this.EstateName) && string.IsNullOrEmpty(this.BuildName))
                            {
                                var build = buildService.GetBuild(centaUnit.BuildId);
                                this.BuildName  = build.BuildName;
                                this.EstateName = build.Estate.EstateName;
                                this.Address    = build.Estate.Address;
                            }
                        }
                        this.UnitCollection = string.Join(",", unit.ToArray());
                    }
                }
                else
                {
                    string   unitId           = ConvertUtility.Trim(Request.Form["unitId"]);
                    string[] unitIdCollection = unitId.Split(new string[] { AppSettings.FirstSplit }, StringSplitOptions.RemoveEmptyEntries);
                    decimal  area             = ConvertUtility.ToDecimal(Request.Form["area"]);
                    int      countf           = ConvertUtility.ToInt(Request.Form["countf"]);
                    int      countt           = ConvertUtility.ToInt(Request.Form["countt"]);
                    int      countw           = ConvertUtility.ToInt(Request.Form["countw"]);
                    string   direction        = ConvertUtility.Trim(Request.Form["direction"]);
                    //if (unitService.UpdateUnit(unitIdCollection, area, countf, countt, countw, direction))
                    //{
                    //    Response.Write("true");
                    //}
                    //else
                    //{
                    //    Response.Write("false");
                    //}
                    Response.End();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 4
0
 public static bool Remove(string id)
 {
     try
     {
         BuildCtService buildService = new BuildCtService();
         if (buildService.RemoveBuild(id))
         {
             return(true);
         }
         return(false);
     }
     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;
            }
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                int    recordCount;
                string type     = ConvertUtility.Trim(Request.QueryString["type"]);
                string estateId = ConvertUtility.Trim(Request.QueryString["code"]);

                this.EstateId = estateId;
                this.PageSize = AppSettings.PageSize;
                EstateCmService estateService = new EstateCmService();
                EstateCm        estate        = estateService.GetEstateById(this.EstateId);
                this.TitleBar = estate.ToNavBar(false);
                BuildCtService buildService = new BuildCtService();
                this.BuildCollection = buildService.ListBuild(this.EstateId, 1, this.PageSize, out recordCount);
                this.RecordCount     = recordCount;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        static void Estate_C2F_Ing(string estateId)
        {
            //
            DateTime        begin           = DateTime.Now;
            EstateCtService estateCtService = new EstateCtService();
            EstateCtType    estateCtType    = estateCtService.GetEstateTypeById(estateId);
            EstateFwType    estateFwType    = new EstateFwType(estateCtType);
            EstateFwService estateFwService = new EstateFwService();

            estateFwService.ImportEstate(estateFwType);
            BuildCtService     buildCtService = new BuildCtService();
            List <BuildCtType> buildType      = buildCtService.ListBuild(estateId).ToList();

            if (buildType != null && buildType.Count > 0)
            {
                buildType.ForEach(item =>
                {
                    Console.WriteLine("时间: {0}, 开始导入栋座[{1}]..", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), item.BuildName);
                    Build_C2F(item);
                });
            }
            DateTime end = DateTime.Now;
        }
        static void Build_A2C(BuildCmType buildCmType)
        {
            //
            DateTime        begin           = DateTime.Now;
            EstateCtService estateCtService = new EstateCtService();
            BuildCtType     buildCtType     = new BuildCtType(buildCmType);
            BuildCtService  buildCtService  = new BuildCtService();

            buildCtService.ImortBuild(buildCtType);
            BuildCmService    buildCmService = new BuildCmService();
            UnitCmService     unitCmService  = new UnitCmService();
            List <UnitCmType> unitType       = unitCmService.ListUnit(buildCmType.BuildId).ToList();

            if (unitType != null && unitType.Count > 0)
            {
                unitType.ForEach(item =>
                {
                    Console.WriteLine("时间: {0}, 导入单元[{1}]..", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), item.CY_Axis + item.CX_Axis);
                    Unit_A2C(item);
                });
            }
            DateTime end = DateTime.Now;
        }