示例#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;
            }
        }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string         httpMethod   = Request.HttpMethod;
         string         buildId      = ConvertUtility.Trim(Request.QueryString["id"]);
         BuildCtService buildService = new BuildCtService();
         if (httpMethod.Equals("get", StringComparison.OrdinalIgnoreCase))
         {
             this.Build = buildService.GetBuild(buildId);
         }
         else
         {
             //UpdateData
             string buildName = ConvertUtility.Trim(Request.Form["buildName"]);
             if (buildService.UpdateBuild(buildId, buildName, this.UserInfo.UserId))
             {
                 Response.Write("true");
             }
             else
             {
                 Response.Write("false");
             }
             Response.End();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#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;
            }
        }
        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;
            }
        }