コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string         httpMethod   = Request.HttpMethod;
         string         buildId      = ConvertUtility.Trim(Request.QueryString["id"]);
         BuildFwService buildService = new BuildFwService();
         if (httpMethod.Equals("get", StringComparison.OrdinalIgnoreCase))
         {
             this.Build = buildService.GetBuild(buildId);
         }
         else
         {
             //UpdateData
             string buildName = ConvertUtility.Trim(Request.Form["buildName"]);
             string address   = ConvertUtility.Trim(Request.Form["address"]);
             if (buildService.UpdateBuild(buildId, buildName, address))
             {
                 Response.Write("true");
             }
             else
             {
                 Response.Write("false");
             }
             Response.End();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #2
0
 public static bool Complete(string id)
 {
     try
     {
         BuildFwService buildService = new BuildFwService();
         if (buildService.Completed(id))
         {
             return(true);
         }
         return(false);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #3
0
        static void CompareBuild(string agencyCom_EstateId)
        {
            BuildCmService     buildCmService     = new BuildCmService();
            List <BuildCmType> agencyComBuildList = buildCmService.ListBuild(agencyCom_EstateId).ToList();
            BuildFwService     buildFwService     = new BuildFwService();
            List <BuildFwType> frameworkBuildList = buildFwService.ListBuildByCm(agencyCom_EstateId).ToList();

            if (frameworkBuildList != null && frameworkBuildList.Count > 0)
            {
                frameworkBuildList.ForEach(agencyComBuild =>
                {
                    if (agencyComBuildList != null && agencyComBuildList.Count > 0)
                    {
                        var obj = agencyComBuildList.Find(item => item.BuildName == agencyComBuild.BuildName);
                        if (obj != null)
                        {
                            agencyComBuildList.RemoveAll(item => item.BuildName == agencyComBuild.BuildName);

                            Console.WriteLine("时间 : [{0}], 比较栋座 [{1}]", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), obj.BuildName);
                            buildCmService.InsertComparedBuild(obj.BuildId, obj.EstateId, obj.BuildName, obj.Address, agencyComBuild.BuildId, agencyComBuild.EstateId, agencyComBuild.BuildName, agencyComBuild.Address, CompareUnit(obj.BuildId, agencyComBuild.BuildId));
                        }
                        else
                        {
                            buildCmService.InsertComparedBuild(string.Empty, string.Empty, string.Empty, string.Empty, agencyComBuild.BuildId, agencyComBuild.EstateId, agencyComBuild.BuildName, agencyComBuild.Address, ComparedStatus.ADDNEW);
                            Console.WriteLine("时间 : [{0}], 比较栋座 [{1}]", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), agencyComBuild.BuildName);
                            CompareUnit(string.Empty, agencyComBuild.BuildId);
                        }
                    }
                    else
                    {
                        buildCmService.InsertComparedBuild(string.Empty, string.Empty, string.Empty, string.Empty, agencyComBuild.BuildId, agencyComBuild.EstateId, agencyComBuild.BuildName, agencyComBuild.Address, ComparedStatus.ADDNEW);
                        Console.WriteLine("时间 : [{0}], 比较栋座 [{1}]", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), agencyComBuild.BuildName);
                        CompareUnit(string.Empty, agencyComBuild.BuildId);
                    }
                });
            }
            //delete
            if (agencyComBuildList != null && agencyComBuildList.Count > 0)
            {
                agencyComBuildList.ForEach(agencyComBuild =>
                {
                    buildCmService.InsertComparedBuild(agencyComBuild.BuildId, agencyComBuild.EstateId, agencyComBuild.BuildName, agencyComBuild.Address, string.Empty, string.Empty, string.Empty, string.Empty, ComparedStatus.DELETE);
                    CompareUnit(agencyComBuild.BuildId, string.Empty);
                });
            }
        }
コード例 #4
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"]);
         int    pageIndex = ConvertUtility.ToInt(Request.QueryString["pageIndex"]);
         this.PageSize = AppSettings.PageSize;
         BuildFwService buildService = new BuildFwService();
         this.BuildCollection = buildService.ListBuild(estateId, pageIndex, this.PageSize, out recordCount);
         this.RecordCount     = recordCount;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
        static void Build_C2F(BuildCtType buildCtType)
        {
            //
            DateTime       begin          = DateTime.Now;
            BuildFwType    buildFwType    = new BuildFwType(buildCtType);
            BuildFwService buildFwService = new BuildFwService();

            buildFwService.ImortBuild(buildFwType);
            UnitCtService     unitCtService = new UnitCtService();
            List <UnitCtType> unitType      = unitCtService.ListUnit(buildFwType.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_C2F(item);
                });
            }
            DateTime end = DateTime.Now;
        }
コード例 #7
0
        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))
                {
                    EstateFwService estateService = new EstateFwService();
                    this.Estate = estateService.GetEstateById(estateId);
                }
                else
                {
                    //AddData
                    string buildName = ConvertUtility.Trim(Request.Form["buildName"]);
                    string address   = ConvertUtility.Trim(Request.Form["address"]);
                    int    x_cnt     = ConvertUtility.ToInt(Request.Form["x_cnt"]);
                    bool   x_except  = ConvertUtility.ToBoolean(Request.Form["x_except"]);
                    int    y_cnt_b   = ConvertUtility.ToInt(Request.Form["y_cnt_b"]);
                    int    y_cnt_e   = ConvertUtility.ToInt(Request.Form["y_cnt_e"]);
                    bool   y_except  = ConvertUtility.ToBoolean(Request.Form["y_except"]);

                    BuildFwService buildService = new BuildFwService();
                    if (buildService.AddBuild(estateId, buildName, address, x_cnt, x_except, y_cnt_b, y_cnt_e, y_except))
                    {
                        Response.Write("true");
                    }
                    else
                    {
                        Response.Write("false");
                    }
                    Response.End();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #8
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;
                EstateFwService estateService = new EstateFwService();
                EstateFw        estate        = estateService.GetEstateById(this.EstateId);
                this.TitleBar = estate.ToNavBar(false);
                BuildFwService buildService = new BuildFwService();
                this.BuildCollection = buildService.ListBuild(this.EstateId, 1, this.PageSize, out recordCount);
                this.RecordCount     = recordCount;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #9
0
        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))
                {
                    EstateFwService estateService = new EstateFwService();
                    this.Estate = estateService.GetEstateById(estateId);
                }
                else
                {
                    //AddData
                    string buildName1 = ConvertUtility.Trim(Request.Form["buildName_B"]);
                    string buildName2 = ConvertUtility.Trim(Request.Form["buildName_E"]);

                    string buildName = ConvertUtility.Trim(Request.Form["buildName"]);
                    string address   = ConvertUtility.Trim(Request.Form["address"]);
                    int    x_cnt     = ConvertUtility.ToInt(Request.Form["x_cnt"]);
                    bool   x_except  = ConvertUtility.ToBoolean(Request.Form["x_except"]);
                    int    y_cnt_b   = ConvertUtility.ToInt(Request.Form["y_cnt_b"]);
                    int    y_cnt_e   = ConvertUtility.ToInt(Request.Form["y_cnt_e"]);
                    bool   y_except  = ConvertUtility.ToBoolean(Request.Form["y_except"]);

                    BuildFwService            buildService = new BuildFwService();
                    System.Text.ASCIIEncoding encoding     = new System.Text.ASCIIEncoding();
                    byte[] b1 = encoding.GetBytes(buildName1.ToUpper());
                    byte[] b2 = encoding.GetBytes(buildName2.ToUpper());
                    int    c  = b2[0] - b1[0];
                    if (c >= 0 && b2[0] < 90 && b1[0] > 64)
                    {
                        for (int idx = b1[0]; idx <= b2[0]; idx++)
                        {
                            char[] name = encoding.GetChars(new byte[] { (byte)idx });
                            buildService.AddBuild(estateId, name[0].ToString() + buildName, address, x_cnt, x_except, y_cnt_b, y_cnt_e, y_except);
                        }
                        Response.Write("true");
                    }
                    else
                    {
                        int buildName_B = ConvertUtility.ToInt(buildName1);
                        int buildName_E = ConvertUtility.ToInt(buildName2);
                        if (buildName_E >= buildName_B)
                        {
                            while (buildName_B <= buildName_E)
                            {
                                buildService.AddBuild(estateId, buildName_B + buildName, address, x_cnt, x_except, y_cnt_b, y_cnt_e, y_except);

                                buildName_B++;
                                if (buildName_B > buildName_E)
                                {
                                    break;
                                }
                            }
                            Response.Write("true");
                        }
                        else
                        {
                            Response.Write("false");
                        }
                    }
                    Response.End();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #10
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))
                {
                    BuildFwService buildService = new BuildFwService();
                    this.Build = buildService.GetBuild(buildId);
                }
                else
                {
                    int    x_axis_c      = ConvertUtility.ToInt(Request.Form["x_axis"]);
                    string x_axis_t      = ConvertUtility.Trim(Request.Form["x_axis_t"]);
                    bool   x_axis_except = ConvertUtility.ToBoolean(Request.Form["x_axis_except"]);

                    int  y_axis_b      = ConvertUtility.ToInt(Request.Form["y_axis_b"]);
                    int  y_axis_e      = ConvertUtility.ToInt(Request.Form["y_axis_e"]);
                    bool y_axis_except = ConvertUtility.ToBoolean(Request.Form["y_axis_except"]);

                    int    countf      = ConvertUtility.ToInt(Request.Form["countf"]);
                    int    countt      = ConvertUtility.ToInt(Request.Form["countt"]);
                    int    countw      = ConvertUtility.ToInt(Request.Form["countw"]);
                    int    county      = ConvertUtility.ToInt(Request.Form["county"]);
                    float  area        = ConvertUtility.ToFloat(Request.Form["area"]);
                    string directionTo = ConvertUtility.Trim(Request.Form["directionTo"]);

                    if (y_axis_b <= y_axis_e)
                    {
                        UnitFwService unitService = new UnitFwService();
                        string        x_axis      = string.Empty;
                        string        y_axis      = string.Empty;
                        for (int y = y_axis_b; y <= y_axis_e; y++)
                        {
                            if (y_axis_except && y.ToString().IndexOf("4") >= 0)
                            {
                                continue;
                            }
                            for (int x = 1; x <= x_axis_c; x++)
                            {
                                y_axis = y.ToString();
                                x_axis = x.ToString();
                                if (x_axis_t.Equals("a"))
                                {
                                    int ascii = x + 64;
                                    if (x > 90)
                                    {
                                        continue;
                                    }
                                    else
                                    {
                                        System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
                                        char[] chars = encoding.GetChars(new byte[] { (byte)ascii });
                                        x_axis = chars[0].ToString();
                                    }
                                }
                                else
                                {
                                    if (x_axis_except && x.ToString().IndexOf("4") >= 0)
                                    {
                                        continue;
                                    }
                                }
                                unitService.AddUnit(buildId, x_axis, y_axis, countf, countt, countw, county, area, directionTo);
                            }
                        }

                        Response.Write("true");
                    }
                    else
                    {
                        Response.Write("false");
                    }
                    Response.End();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }