Exemplo n.º 1
0
        //儲存資料
        protected void SaveAction(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();

            //檢查標題文字
            ErrorString += (StageName.Text) == string.Empty ? "階段名稱請填入!!\\n" : "";
            ErrorString += (DurationType.SelectedIndex) == -1 ? "工期方式請選擇!!\\n" : "";
            ErrorString += (Duration.Text) == string.Empty ? "開工期限天數請填入!!\\n" : "";
            ErrorString += (PunishType.SelectedIndex) == -1 ? "完工提報期限請填入!!\\n" : "";
            ErrorString += (Punish.Text) == string.Empty ? "工期延展請填入!!\\n" : "";
            ErrorString += (Notes.Text) == string.Empty ? "工期延展請填入!!\\n" : "";


            //確認是否全選
            if (ErrorString == "")
            {
                //確認選項是否存在或過期
                if (Session["ProjectCode"] == null)
                {
                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
                }
                else
                {
                    WebModel.EditAction_pro(database, _TableName, Session["ProjectCode"].ToString(), GetDataBox());

                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改完成');", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('" + ErrorString + "');", true);
            }
        }
Exemplo n.º 2
0
        //儲存資料
        protected void SaveAction(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();

            //檢查標題文字
            //ErrorString += (StartDeadlinetype.SelectedIndex) == -1 ? "開工期限方式請選擇!!\\n" : "";
            //ErrorString += (StartDeadline.Text) == string.Empty ? "開工期限天數請填入!!\\n" : "";
            //ErrorString += (CompletionEscDeadline.Text) == string.Empty ? "完工提報期限請填入!!\\n" : "";
            //ErrorString += (DelayEscDeadline.Text) == string.Empty ? "工期延展請填入!!\\n" : "";



            //確認是否全選
            if (ErrorString == "")
            {
                //確認選項是否存在或過期
                if (Session["ProjectCode"] == null)
                {
                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
                }
                else
                {
                    //確認資料庫是否有資料
                    if (datacheck(Session["ProjectCode"].ToString()) == false)
                    {
                        string result = WebModel.SaveAction_pro(database, _TableName, GetDataBox(), Session["ProjectCode"].ToString());
                        if (result != "0")
                        {
                            ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('存檔完成');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('存檔失敗');", true);
                        }
                    }
                    else
                    {
                        bool result = WebModel.EditAction_pro(database, _TableName, Session["ProjectCode"].ToString(), GetDataBox());
                        if (result)
                        {
                            ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改完成');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改失敗');", true);
                        }
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('" + ErrorString + "');", true);
            }
        }
Exemplo n.º 3
0
        //儲存資料
        protected void SaveAction(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();

            //檢查標題文字
            ErrorString += (RBContractWay.SelectedIndex) == -1 ? "承攬方式請選擇!!\\n" : "";
            ErrorString += (DDLDurationType.SelectedIndex) == 0 ? "工期計算方式請選擇!!\\n" : "";
            ErrorString += (TxOContrctPrice.Text) == string.Empty ? "原合約總價請填入!!\\n" : "";
            ErrorString += (TxOwnerName.Text) == string.Empty ? "工地電話請填入!!\\n" : "";
            ErrorString += (TxDuration.Text) == string.Empty ? "工期請填入!!\\n" : "";



            //確認是否全選
            if (ErrorString == "")
            {
                //確認選項是否存在或過期
                if (Session["ProjectCode"] == null)
                {
                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
                }
                else
                {
                    //確認資料庫是否有資料
                    if (datacheck(Session["ProjectCode"].ToString()) == false)
                    {
                        WebModel.SaveAction_pro(database, _TableNameM2, GetDataBox(), Session["ProjectCode"].ToString());

                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('存檔完成');", true);
                        //Response.Redirect("ProjectInfo1View.aspx");
                    }
                    else
                    {
                        WebModel.EditAction_pro(database, _TableNameM2, Session["ProjectCode"].ToString(), GetDataBox());
                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改完成');", true);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('" + ErrorString + "');", true);
            }
        }
Exemplo n.º 4
0
        //儲存資料
        protected void SaveAction(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();

            //檢查標題文字
            //ErrorString += (PriceSubsidyNY.SelectedIndex) == -1 ? "物價補貼請選擇!!\\n" : "";
            //ErrorString += (PrepayPercentage.Text) == string.Empty ? "預付款百分比請填入!!\\n" : "";
            //ErrorString += (EstAcceptNum.Text) == string.Empty ? "估驗頻率請填入!!\\n" : "";
            //ErrorString += (EstAcceptUnit.Text) == string.Empty ? "估驗頻率/(次)請填入!!\\n" : "";
            //ErrorString += (EstAcceptDate1.Text) == string.Empty ? "估驗日期1請填入!!\\n" : "";
            //ErrorString += (EstAcceptDate2.Text) == string.Empty ? "估驗日期2請填入!!\\n" : "";
            //ErrorString += (RetentionPercentage.Text) == string.Empty ? "保留款百分比請填入!!\\n" : "";
            //ErrorString += (OtherPayment.Text) == string.Empty ? "其他付款規定請填入!!\\n" : "";

            //確認是否全選
            if (ErrorString == "")
            {
                //確認選項是否存在或過期
                if (Session["ProjectCode"] == null)
                {
                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
                }
                else
                {
                    //確認資料庫是否有資料
                    if (datacheck(Session["ProjectCode"].ToString()) == false)
                    {
                        WebModel.SaveAction_pro(database, _TableName, GetDataBox(), Session["ProjectCode"].ToString());

                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('存檔完成');", true);
                    }
                    else
                    {
                        WebModel.EditAction_pro(database, _TableName, Session["ProjectCode"].ToString(), GetDataBox());
                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改完成');", true);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('" + ErrorString + "');", true);
            }
        }
Exemplo n.º 5
0
        //儲存資料
        protected void SaveAction(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();

            //檢查標題文字
            //ErrorString += (DDLEngCountry.SelectedIndex) == 0 ? "工程所在國家請選擇!!\\n" : "";
            //ErrorString += (DDLEngLocation.SelectedIndex) == 0 ? "工程所在縣市請選擇!!\\n" : "";
            ErrorString += (TxSitePerson.Text) == string.Empty ? "工地負責人請填入!!\\n" : "";
            ErrorString += (TxSiteTel.Text) == string.Empty ? "工地電話請填入!!\\n" : "";
            ErrorString += (TxOwnerName.Text) == string.Empty ? "業主名稱請填入!!\\n" : "";
            ErrorString += (TxOwnerContactPerson.Text) == string.Empty ? "業主聯絡人請填入!!\\n" : "";


            //確認是否全選
            if (ErrorString == "")
            {
                //確認選項是否存在或過期
                if (Session["ProjectCode"] == null)
                {
                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
                }
                else
                {
                    //確認資料庫是否有資料
                    if (datacheck(Session["ProjectCode"].ToString()) == false)
                    {
                        WebModel.SaveAction_pro(database, _TableNameM1, GetDataBox(), Session["ProjectCode"].ToString());

                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('存檔完成');", true);
                        Response.Redirect("ProjectInfo1View.aspx");
                    }
                    else
                    {
                        WebModel.EditAction_pro(database, _TableNameM1, Session["ProjectCode"].ToString(), GetDataBox());
                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改完成');", true);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('" + ErrorString + "');", true);
            }
        }
Exemplo n.º 6
0
        //儲存資料
        protected void SaveAction(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();

            //檢查標題文字

            //ErrorString += (ContractCaution1.Text) == string.Empty ? "契約終止請填入!!\\n" : "";
            //ErrorString += (ContractCaution2.Text) == string.Empty ? "變更設計請填入!!\\n" : "";
            //ErrorString += (ContractCaution3.Text) == string.Empty ? "爭議處理請填入!!\\n" : "";
            //ErrorString += (ContractCaution4.Text) == string.Empty ? "其他請填入!!\\n" : "";


            //確認是否全選
            if (ErrorString == "")
            {
                //確認選項是否存在或過期
                if (Session["ProjectCode"] == null)
                {
                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
                }
                else
                {
                    //確認資料庫是否有資料
                    if (datacheck(Session["ProjectCode"].ToString()) == false)
                    {
                        WebModel.SaveAction_pro(database, _TableName, GetDataBox(), Session["ProjectCode"].ToString());

                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('存檔完成');", true);
                    }
                    else
                    {
                        WebModel.EditAction_pro(database, _TableName, Session["ProjectCode"].ToString(), GetDataBox());
                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改完成');", true);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('" + ErrorString + "');", true);
            }
        }
Exemplo n.º 7
0
        //儲存資料
        protected void SaveAction(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();

            //檢查標題文字
            ErrorString += (DropDownList1.SelectedIndex) == 0 ? "標案請選擇!!\\n" : "";
            ErrorString += (TxProjectCode.Text) == string.Empty ? "專案(工程)編號請填入!!\\n" : "";
            ErrorString += (TxProjectName.Text) == string.Empty ? "專案(工程)名稱請填入!!\\n" : "";
            ErrorString += (TxProjectNickname.Text) == string.Empty ? "專案(工程)簡稱請填入!!\\n" : "";



            //確認是否全選
            if (ErrorString == "")
            {
                //確認選項是否存在或過期
                if (Session["bid"] == null)
                {
                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
                }
                else
                {
                    //確認資料庫是否有資料
                    if (datacheck(Session["bid"].ToString()) == false)
                    {
                        WebModel.SaveAction_pro(database, _TableName, GetDataBox(), Session["ProjectCode"].ToString());

                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('存檔完成');", true);
                    }
                    else
                    {
                        WebModel.EditAction_pro(database, _TableName, Session["bid"].ToString(), GetDataBox());
                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改完成');", true);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('" + ErrorString + "');", true);
            }
        }
Exemplo n.º 8
0
        //儲存資料
        protected void SaveAction(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();

            //檢查標題文字

            ErrorString += (WarrantyPercentage.Text) == string.Empty ? "保固百分比請填入!!\\n" : "";
            ErrorString += (OtherWarranty.Text) == string.Empty ? "其他保固規定請填入!!\\n" : "";



            //確認是否全選
            if (ErrorString == "")
            {
                //確認選項是否存在或過期
                if (Session["ProjectCode"] == null)
                {
                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
                    Response.Redirect("ProjectDurationE.aspx");
                }
                else
                {
                    //確認資料庫是否有資料
                    if (datacheck(Session["ProjectCode"].ToString()) == false)
                    {
                        WebModel.SaveAction_pro(database, _TableName, GetDataBox(), Session["ProjectCode"].ToString());

                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('存檔完成');", true);
                    }
                    else
                    {
                        WebModel.EditAction_pro(database, _TableName, Session["ProjectCode"].ToString(), GetDataBox());
                        ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改完成');", true);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('" + ErrorString + "');", true);
            }
        }
Exemplo n.º 9
0
        //儲存資料
        protected void SaveAction1(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();

            //檢查標題文字
            ErrorString += (DropDownList1.SelectedIndex) == 0 ? "標案請選擇!!\\n" : "";
            ErrorString += (TxProjectCode.Text) == string.Empty ? "專案(工程)編號請填入!!\\n" : "";
            ErrorString += (TxProjectName.Text) == string.Empty ? "專案(工程)名稱請填入!!\\n" : "";
            //ErrorString += (TxProjectNickname.Text) == string.Empty ? "專案(工程)簡稱請填入!!\\n" : "";



            //確認是否全選
            if (ErrorString == "")
            {
                //確認選項是否存在或過期
                if (Session["bid"] == null)
                {
                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
                }
                else
                {
                    //確認資料庫是否有資料
                    if (datacheck(Session["bid"].ToString()) == false)
                    {
                        string result = WebModel.SaveAction_pro(database, _TableName, GetDataBox1(), Session["ProjectCode"].ToString());
                        if (result != "0")
                        {
                            string SQLPId       = "Select MAX(PID) as pid from CBudget_WBS";
                            int    PID          = int.Parse(WebModel.SItemName(database, SQLPId, "pid")) + 1;
                            string SQLUpdateWBS = "INSERT INTO CBudget_WBS (PID,LayerCode,LayerNum,UpperWID,SortNum,ItemOrder,ItemName,Unit,ItemKind,CNumber,order_Num) SELECT " + PID + " as PID ,LayerCode,LayerNum,UpperUID as UpperWID,SortNum,ItemOrder,ItemName,Unit,ItemKind,Number as CNumber,order_Num FROM Bid_WBS where bid=" + Session["Bid"].ToString();
                            //bool result1 = WebModel.SQLAction(database, SQLUpdateWBS);
                            string SQLUpdateResource = "INSERT INTO Pro_Resource (PID,ItemName,Unit,Code,Complex,AnaNumber,CPrice,ItemKind) SELECT " + PID + " as PID ,ItemName,Unit,Code,Complex,AnaNumber,Price as CPrice,ItemKind FROM Bid_Library where bid=" + Session["Bid"].ToString();
                            //bool result2 = WebModel.SQLAction(database, SQLUpdateResource);
                            bool result3 = CBudgetDisp.Transfer_PriceIDtoWBS(database, Session["Bid"].ToString());

                            ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('存檔完成');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('存檔失敗');", true);
                        }
                    }
                    else
                    {
                        bool result = WebModel.EditAction_pro(database, _TableName, Session["bid"].ToString(), GetDataBox1());
                        if (result)
                        {
                            string SQLPId            = "Select MAX(PID) as pid from CBudget_WBS";
                            int    PID               = int.Parse(WebModel.SItemName(database, SQLPId, "pid")) + 1;
                            string SQLUpdateWBS      = "INSERT INTO CBudget_WBS (Temp_id,PID,LayerCode,LayerNum,UpperWID,SortNum,ItemOrder,ItemName,Unit,ItemKind,CNumber,order_Num) SELECT UID," + PID + " as PID ,LayerCode,LayerNum,UpperUID as UpperWID,SortNum,ItemOrder,ItemName,Unit,ItemKind,Number as CNumber,order_Num FROM Bid_WBS where bid=" + Session["Bid"].ToString();
                            bool   result1           = WebModel.SQLAction(database, SQLUpdateWBS);
                            string SQLUpdateResource = "INSERT INTO Pro_Resource (Temp_id,PID,ItemName,Unit,Code,Complex,AnaNumber,CPrice,ItemKind) SELECT PriceID," + PID + " as PID ,ItemName,Unit,Code,Complex,AnaNumber,Price as CPrice,ItemKind FROM Bid_Library where bid=" + Session["Bid"].ToString();
                            //bool result2 = WebModel.SQLAction(database, SQLUpdateResource);
                            bool result3 = CBudgetDisp.Transfer_PriceIDtoWBS(database, Session["Bid"].ToString());
                            ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改完成');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('修改失敗');", true);
                        }
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('" + ErrorString + "');", true);
            }
        }