示例#1
0
        protected void Add_Click(object sender, EventArgs e)
        {
            string database  = Session["DatabaseName"].ToString();
            string datatable = "Pro_Resource";

            ErrorString += (DDLKind.SelectedValue) == "0" ? "請輸入工項類型!!\\n" : "";
            ErrorString += (TxItemName.Text) == string.Empty ? "請輸入名稱!!\\n" : "";
            string ItemName = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxItemName.Text));
            bool   select   = datacheck(ItemName, DDL_Unit.SelectedValue);

            if (select == true)
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 已有相同工料名稱');", true);
            }
            else
            {
                //確認是否全選
                if (ErrorString == "")
                {
                    WebModel.SaveAction(database, datatable, GetDataBox());

                    //Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "addLayerCode();", true);//ajax 新增階層碼
                }
                else
                {
                    ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('" + ErrorString + "');", true);
                }
                TxItemName.Text       = "";
                DDLKind.SelectedValue = "0";
                TxNotes.Text          = "";
            }
        }
示例#2
0
        protected void Search_Click(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();
            string ItemName = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxSearch.Text));


            #region 搜尋條件
            string SelectString = "";
            SelectString = (ItemName != "") ? "ItemName like '%" + ItemName + "%' " + DDL_Op1.SelectedValue + "" : "";

            if (ItemName == "")
            {
                if (DDL_Op1.SelectedValue == "and")
                {
                    SelectString += "";
                }
                else if (DDL_Op1.SelectedValue == "or")
                {
                    SelectString += "";
                }
                else if (DDL_Op1.SelectedValue == "and NOT")
                {
                    SelectString += "not";
                }
            }

            SelectString += (DropDownList5.SelectedItem.Value != "0") ? " ResponseDept = '" + DropDownList5.SelectedValue + "'" : "";
            SelectString  = (SelectString.Length > 1) ? "where " + SelectString : "";
            #endregion

            SqlDataSource2.SelectCommand += SelectString;
            GridView1.DataBind();
        }
示例#3
0
        public bool datacheck()
        {
            string database  = Session["DatabaseName"].ToString();
            string SQLString = "Select * from EBudget_Change_Detail where EWID=" + SystemSet.GetRequestSet("EWID") + "";

            if (Session["ProjectCode"] == null)
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
            }
            else
            {
                DataTable DataTableBox = WebModel.LoadSetContentData(database, SQLString);
                if (DataTableBox != null && DataTableBox.Rows.Count > 0)
                {
                    foreach (DataRow row in DataTableBox.Rows)
                    {
                        UId = row["UID"].ToString();
                    }
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            return(false);
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.asaction = SystemSet.GetString(base.Request["action"], string.Empty);

            if (this.asaction == "addsave")
            {
                //string SQLString = "Select MAX(UID) as uid from Bid_WBS where bid=" + Session["Bid"].ToString() + "";
                string    SQLString    = "Select * from EBudget_WBS where Pid=" + Session["ProjectCode"].ToString() + "";
                string    database     = Session["DatabaseName"].ToString();
                DataTable DataTableBox = WebModel.LoadSetContentData(database, SQLString);
                if (DataTableBox != null && DataTableBox.Rows.Count > 0)
                {
                    foreach (DataRow row in DataTableBox.Rows)
                    {
                        uid = int.Parse(row["EWID"].ToString());
                        main(uid);
                    }
                }
            }
            if (this.asaction == "Delete")
            {
                string uid      = base.Request["uid"];
                string database = Session["DatabaseName"].ToString();

                string SQLString = "Delete EBudget_WBS where EWID=" + uid + "";
                bool   result    = WebModel.SQLAction(database, SQLString);
            }
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((Session["UserName"] == null) || (Session["CompanyName"] == null || (Session["ProjectCode"] == null)))
            {
                Response.Redirect("Main.aspx");
            }
            if (!IsPostBack)
            {
                SqlDataSource1.SelectCommand = Sql;
                LoadContent();
            }


            SqlDataSource1.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
            if (SystemSet.GetRequestSet("PriceID") != "")
            {
                SqlDataSource1.SelectCommand = "select * from  Pro_Resource where  PID=" + Session["ProjectCode"].ToString() + " AND PriceID not in (select KidID from Pro_Analysis where ParentID=" + PriceID + ") and PriceID<>" + PriceID + "";
                Sql = SqlDataSource1.SelectCommand;
            }
            else
            {
                //SqlDataSource1.SelectCommand = "Select  *  from Bid_AnaRelation a left join Bid_Library b on a.KidID=b.PriceID left join Bid_WBS c on b.PriceID=c.PriceID where a.ParentID=" + PriceID + " and b.BID=" + Session["bid"].ToString() + " order by A.SortNum";
                //SqlDataSource1.SelectCommand = "Select  *  from Bid_AnaRelation a left join Bid_Library b on a.KidID=b.PriceID left join Bid_WBS c on b.PriceID=c.PriceID where  b.BID=" + Session["bid"].ToString() + "and b.ItemKind='拆工拆料項' or b.ItemKind='連工帶料項' order by A.SortNum";
                SqlDataSource1.SelectCommand = "select * from  Pro_Resource where  PID=" + Session["ProjectCode"].ToString() + "";
            }
            string database = Session["DatabaseName"].ToString();
            string FdSearch = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxSearch.Text));

            //SqlDataSource sql = new SqlDataSource();
            SqlDataSource1.SelectCommand = Sql;
        }
示例#6
0
        void Save(ref bool saveState, string key, SystemSet systemSet)
        {
            mObjOn[(int)systemSet].SetActive(saveState);
            mObjOff[(int)systemSet].SetActive(!saveState);
            int state = saveState ? 1 : 0;

            PlayerPrefs.SetInt(key, state);

            switch (systemSet)
            {
            case SystemSet.SoundButton:
                AudioManager.Instance.EnableSound(saveState);
                break;

            case SystemSet.MusicButton:
                AudioManager.Instance.EnableVoice(saveState);
                break;

            case SystemSet.EffectButton:
                BattleInfoCtrl.Instance.SetEffect(saveState);
                break;

            case SystemSet.RangeButton:
                GameMethod.SetRange(saveState);
                break;
            }
        }
示例#7
0
        protected void BtnSearch_Click(object sender, EventArgs e)
        {
            //ViewState["all"] = false;
            string FdSearch = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxSearch.Text));

            //Session["FdSearch"] = FdSearch;
            Sql = "";
            string SelectString = "";

            if (PriceID == "")
            {
                PriceID = "0";
            }
            SqlDataSource1.SelectCommand = "select * from  Pro_Resource where  PID=" + Session["ProjectCode"].ToString() + " AND PriceID not in (select KidID from Pro_Analysis where ParentID=" + PriceID + ") and PriceID<>" + PriceID + "";
            Sql = SqlDataSource1.SelectCommand;

            //SqlDataSource1.SelectCommand = "select * from  Pro_Resource where  PID=" + Session["ProjectCode"].ToString() + " AND PriceID not in (select KidID from Pro_Analysis where ParentID=" + PriceID + ") and PriceID<>" + PriceID + "";
            SelectString  = (DDL_Res.SelectedValue == "1") ? "Complex = " + DDL_Res.SelectedValue + " " : "Complex != 1 ";
            SelectString += (FdSearch != "") ? "" + DDL_Op2.SelectedValue + " ItemName like '%" + FdSearch + "%' " : "";
            SelectString  = (SelectString.Length > 1) ? " and " + SelectString + " " : "";

            Sql += SelectString;
            SqlDataSource1.SelectCommand = Sql;
            GridView1.DataBind();
        }
示例#8
0
        private void btnChgClr2_Click(object sender, EventArgs e)
        {
            Button      btn         = sender as Button;
            ColorDialog colorDialog = new ColorDialog();

            colorDialog.AllowFullOpen = true;
            colorDialog.FullOpen      = true;
            colorDialog.ShowHelp      = true;
            colorDialog.Color         = Color.Red;//初始化当前文本框中的字体颜色,当用户在ColorDialog对话框中点击\"取消\"按钮
            colorDialog.ShowDialog();
            btn.BackColor = colorDialog.Color;

            SystemSet _old = Common.GlobalPrizeSystem.GetSystemSet();

            SystemSet _set = new SystemSet();

            _set.Title1 = _old.Title1;
            _set.Title2 = _old.Title2;

            _set.Clr3 = _old.Clr3;
            _set.Clr4 = ColorTranslator.ToHtml(colorDialog.Color);

            Common.GlobalPrizeSystem.UpdateSystemSet(_set);

            UpdateTitle();
        }
示例#9
0
        protected void BtnSearch_Click(object sender, EventArgs e)
        {
            if (Session["Bid"] != null)
            {
                string database = Session["DatabaseName"].ToString();
                string ItemName = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxPro.Text));

                #region 搜尋條件
                string SelectString = "";

                SelectString = (DDL_Select2.SelectedValue != "0") ? "Type like '%" + DDL_Select2.SelectedValue + "%' " : "";

                SelectString += (ItemName != "") ? "" + DDL_Op2.SelectedValue + " SupportItem like '%" + ItemName + "%' " : "";

                SelectString = (SelectString.Length > 1) ?  SelectString : "";
                #endregion
                SqlDataSource6.SelectCommand  = (SelectString.Length > 1) ? SqlDataSource6.SelectCommand.Substring(0, SqlDataSource6.SelectCommand.Length) : SqlDataSource6.SelectCommand;
                SqlDataSource6.SelectCommand += " where " + SelectString + "";
                GridView4.DataBind();
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請選擇標案');", true);
            }
        }
示例#10
0
        protected void BtnSearch_Click(object sender, EventArgs e)
        {
            string KeyWord = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxKeyWord.Text));

            #region 搜尋條件
            string SelectString = "";

            SelectString = (KeyWord != "") ? "SB_Name like '%" + KeyWord + "%' " : "";
            if (KeyWord != "" && DDL_Op3.SelectedValue != "")
            {
                SelectString += DDL_Op1.SelectedValue + " ";
            }
            SelectString += (DDL_Op3.SelectedValue != "") ? " BudgetLockNY = " + DDL_Op3.SelectedValue + "" : "";

            SelectString = (SelectString.Length > 1) ? SelectString : "";
            SqlDataSource1.SelectCommand  = "";
            SqlDataSource1.SelectCommand  = "SELECT SBID, PID, SB_Code, SB_Name, BookInTime, BookContractDate, LastContractDate, ContractWay, WorkManDep, WorkManName, BudgetPrice, BudgetLockNY, SC_Code FROM SubBudgetList  ";
            SqlDataSource1.SelectCommand  = (SelectString.Length > 1) ? SqlDataSource1.SelectCommand.Substring(0, SqlDataSource1.SelectCommand.Length) : SqlDataSource1.SelectCommand;
            SqlDataSource1.SelectCommand += (SelectString.Length > 1) ? "WHERE " + SelectString + " and PID = " + Session["ProjectCode"].ToString() + "" : " WHERE PID = " + Session["ProjectCode"].ToString() + "";


            #endregion

            GridView1.DataBind();
        }
示例#11
0
        protected void BtnSearch_Click(object sender, EventArgs e)
        {
            string KeyWord = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxSubBudget.Text));

            #region 搜尋條件
            string SelectString = "";

            SelectString = (KeyWord != "") ? "SC_Name like '%" + KeyWord + "%' " : "";
            //if (TxDate1.Text != "")
            //{
            if (KeyWord != "" && DDL_Firm.SelectedValue != "0")
            {
                SelectString += DDL_Op1.SelectedValue;
            }
            if (DDL_Firm.SelectedValue != "0")
            {
                SelectString += " FirmID=" + DDL_Firm.SelectedValue;
            }

            SelectString = (SelectString.Length > 1) ? SelectString : "";
            //SqlDataSource1.SelectCommand = "SELECT SBID, PID, SB_Code, SB_Name, BookInTime, BookContractDate, LastContractDate, ContractWay, WorkManDep, WorkManName, BudgetPrice, BudgetLockNY, SC_Code FROM SubBudgetList  ";
            SqlDataSource1.SelectCommand += (SelectString.Length > 1) ? " and " + SelectString + " and SubContract_Main.pid=" + Session["ProjectCode"].ToString() : "";


            #endregion

            GridView1.DataBind();
        }
示例#12
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            DbHelperSQL.connectionString = conn;

            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;
            string sAccID       = LoginInfo.AccID;

            ClsUserRight clsUser = new ClsUserRight();

            if (clsUser.chkRight(login, "TH_1"))
            {
                SystemSet fm = new SystemSet();
                fm.Conn      = conn;
                fm.sUserID   = sLogUserid;
                fm.sUserName = sLogUserName;
                fm.sLogDate  = sLogDate;
                fm.sAccID    = sAccID;

                this._Title = "System Set";

                return(fm);
            }
            else
            {
                return(null);
            }
        }
示例#13
0
        //取得建入資料
        protected DataTable GetDataBox()
        {
            string    database     = Session["DatabaseName"].ToString();
            DataTable DataTableBox = new DataTable();

            string SQLString = "PID,LayerNum,UpperWID,SortNum,PriceID,ItemName,Unit,ItemKind,Notes,EEdition";

            string SQLUpdateSort;

            foreach (string DataName in SQLString.Split(','))
            {
                DataTableBox.Columns.Add(DataName, typeof(string));
            }


            //後台功能,必需要有的欄位名稱

            DataRow DataTableDr = DataTableBox.NewRow();


            string TopWBS   = DDLTop.SelectedValue;
            string Next     = DDLNext.SelectedValue;
            string ItemName = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxItemName.Text));
            string Notes    = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxNotes.Text));

            //int Number = 0;

            //bool output = int.TryParse(TxQuantity.Text, out Number);
            #region 內容設定
            if (Session["ProjectCode"] != null)
            {
                DataTableDr["Pid"]      = Session["ProjectCode"].ToString();
                DataTableDr["LayerNum"] = DDLLayer.SelectedValue;
                DataTableDr["UpperWID"] = DDLTop.SelectedValue;
                DataTableDr["SortNum"]  = DDLNext.SelectedValue;
                DataTableDr["Unit"]     = DDL_Unit.SelectedValue;
                DataTableDr["ItemName"] = ItemName;
                //DataTableDr["LastCNumber"] = Number;
                DataTableDr["ItemKind"] = DDL_ItemKind.SelectedValue;
                if (Session["thisID"] != null)
                {
                    DataTableDr["PriceId"] = Session["thisID"].ToString() != ""?Session["thisID"].ToString():"0";
                }
                DataTableDr["Notes"]    = Notes;
                DataTableDr["EEdition"] = int.Parse(LbEdition.Text);

                //SortNum = int.Parse(DDLNext.SelectedValue);
                DataTableBox.Rows.Add(DataTableDr);
                #endregion


                SQLUpdateSort = "update EBudget_WBS set sortnum=SortNum+1 where LayerNum=" + DDLLayer.SelectedValue + " and UpperWID=" + DDLTop.SelectedValue + " and SortNum >=" + DDLNext.SelectedValue + "";
                WebModel.SQLAction(database, SQLUpdateSort);
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請重新選擇');", true);
            }
            return(DataTableBox);
        }
示例#14
0
        protected void Loadcontent()
        {
            string database = Session["DatabaseName"].ToString();

            if (SystemSet.GetRequestSet("PriceID") != "")
            {
                string SQLString = "Select a.*,b.* from BidM0 a left join  Bid_Library b on a.bid=b.bid  where b.PriceID ='" + SystemSet.GetRequestSet("PriceID") + "'";//left join RFQ_Material c  on b.PriceID=c.PriceID
                string SQLSelect = "Select PriceID,ItemName,Unit,Code,Amount from Bid_Library where  PriceID ='" + SystemSet.GetRequestSet("PriceID") + "'";
                //string SQLSelect = "SELECT DISTINCT a.PriceID, a.ItemName, a.Unit, a.Amount, a.Code,b.Explan,b.Note FROM Bid_Library a left join RFQ_Material b on a.PriceID=b.PriceID WHERE  a.BID  =" +Session["BID"].ToString() + " and b.PriceID ='" + SystemSet.GetRequestSet("PriceID") + "'";
                DataTable DataTableBox1 = WebModel.LoadSetContentData(database, SQLSelect);
                DataTable DataTableBox  = WebModel.LoadSetContentData(database, SQLString);
                if (DataTableBox != null && DataTableBox.Rows.Count > 0)
                {
                    foreach (DataRow row in DataTableBox.Rows)
                    {
                        LbBidName.Text = row["BidName"].ToString();
                        BidName.Text   = row["BidName"].ToString();
                        //LbItemName.Text = row["ItemName"].ToString();
                        //LbUnit.Text = row["Unit"].ToString();
                        //LbCode.Text = row["Code"].ToString();
                        //LbNumber.Text = row["AnaNumber"].ToString();
                    }

                    Repeater1.DataSource = DataTableBox1;
                    Repeater1.DataBind();
                    Session["DataTable"] = DataTableBox1;
                }
            }
        }
示例#15
0
        protected void BidSearch_Click(object sender, EventArgs e)
        {
            if (Session["Bid"] != null)
            {
                string database = Session["DatabaseName"].ToString();
                string ItemName = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxBidWBS.Text));

                #region 搜尋條件
                string SelectString = "";

                SelectString = (DDL_WBS1.SelectedValue != "0") ? " and Code like '%" + DDL_WBS1.SelectedValue + "%' " : "";

                SelectString += (ItemName != "") ? "" + DDL_Op3.SelectedValue + " ItemName like '%" + ItemName + "%' " : "";

                SelectString = (SelectString.Length > 1) ?  SelectString : "";
                SqlDataSource2.SelectCommand  = "select * from Bid_Library where bid=" + Session["Bid"].ToString() + "";
                SqlDataSource2.SelectCommand  = (SelectString.Length > 1) ? SqlDataSource2.SelectCommand.Substring(0, SqlDataSource2.SelectCommand.Length) : SqlDataSource2.SelectCommand;
                SqlDataSource2.SelectCommand += "" + SelectString + " ORDER BY PriceID DESC";
                Sql = SqlDataSource2.SelectCommand;
                ViewState["Sql"] = Sql;
                #endregion

                GridView1.DataBind();
            }
            else
            {
                ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert(' 請選擇標案');", true);
            }
        }
示例#16
0
        protected void EdConfirm_Click(object sender, EventArgs e)
        {
            string database     = Session["DatabaseName"].ToString();
            string EditItemName = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(EdItemName.Text));
            string EditCode     = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(EdCode.Text));
            string EditNotes    = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(EdNotes.Text));
            string Sql          = "update " + _TableName + " set BID=" + Session["bid"] + ", ";
            string SQRstring    = "";

            SQRstring += (EditItemName != "") ? " ItemName='" + EditItemName + "' ,": "'";
            SQRstring += (DDL_EdUnit.SelectedValue != "") ? " Unit='" + DDL_EdUnit.SelectedValue + "'" : "";
            SQRstring += (EditCode != "") ? ",Code='" + EditCode + "'": "";
            SQRstring += (EditNotes != "") ? ",Notes='" + EditNotes + "'" : "";
            SQRstring += (DDL_edit.SelectedValue != "0") ? ",ItemKind='" + DDL_edit.SelectedItem.Text + "'" : "";

            string Sql1   = (SQRstring.Length > 1) ?Sql + SQRstring + " where PriceID= '" + Session["PriceID"].ToString() + "'" : "";
            bool   result = WebModel.SQLAction(database, Sql1);

            EdItemName.Text        = "";
            EdCode.Text            = "";
            EdNotes.Text           = "";
            DDL_edit.SelectedValue = "0";
            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);
            }
            GridView1.DataBind();
        }
示例#17
0
        private void btn_saveimgpath_Click(object sender, EventArgs e)
        {
            if (tb_choosedimgpath.Text == null || tb_choosedimgpath.Text.Trim().Length == 0)
            {
                MessageBox.Show("请先选择证据图片保存路径!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            string sql = "UPDATE systemset SET EvidenceImgSavePath=@EvidenceImgSavePath WHERE id=1";
            List <MySqlParameter> pars = new List <MySqlParameter>();

            pars.Add(new MySqlParameter("@EvidenceImgSavePath", tb_choosedimgpath.Text));
            try
            {
                DataBaseServer.MySqlCmd dbobj = new DataBaseServer.MySqlCmd();
                if (dbobj.ExecuteNonQueryInt(sql, pars) > 0)
                {
                    SystemSet ss = (SystemSet)GlobalPars.GloPars["systemset"];
                    ss.EvidenceImgSavePath = tb_choosedimgpath.Text;
                    MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("修改失败,请稍后重试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("出现异常,请稍后重试或联系软件提供商!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#18
0
        //取得列表資料
        protected DataTable GetListData()
        {
            DataTable DataTableBox = new DataTable(); //建立表格
            string    SQLString    = "select * from " + _TableName + " a ";
            string    database     = Session["DatabaseName"].ToString();

            #region 搜尋條件
            string SelectString = "";
            SelectString = (Keyword.Text != "") ? "Name like @SelectKey and " : "";
            SelectString = (SelectString.Length > 1) ? "where " + SelectString.Substring(0, SelectString.Length - 4) : "";
            #endregion

            #region 找出總筆數

            //搜尋資料表

            //int AllList = 0;
            using (SqlConnection L_Conn = new SqlConnection(Utility.DBconnection.connect_string(database)))
            {
                using (SqlCommand SelectList = new SqlCommand(SQLString + SelectString, L_Conn))
                {
                    SelectList.Parameters.AddWithValue("@SelectKey", "%" + SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(Keyword.Text)) + "%");

                    SelectList.CommandType = CommandType.Text;
                    L_Conn.Open();
                    SqlDataReader SelectList_read = SelectList.ExecuteReader();
                    DataTableBox = new DataTable();
                    DataTableBox.Load(SelectList_read);
                }
            }
            #endregion

            return(DataTableBox);
        }
示例#19
0
        protected void BtnSearch_Click(object sender, EventArgs e)
        {
            string KeyWord = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxSrSubName.Text));

            #region 搜尋條件
            string SelectString = "";

            //SelectString = (DDL_Sub.SelectedValue != "") ? "SC_Name like '%" + KeyWord + "%' " : "";
            SelectString = (KeyWord != "") ? "" + DDL_Sub.SelectedValue + " like '%" + KeyWord + "%' " : "";

            if (KeyWord != "" && DDL_Firm.SelectedValue != "0")
            {
                SelectString += DDL_Op1.SelectedValue;
            }
            if (DDL_Firm.SelectedValue != "0")
            {
                SelectString += " FirmID=" + DDL_Firm.SelectedValue;
            }

            SelectString = (SelectString.Length > 1) ? SelectString : "";

            SqlDataSource1.SelectCommand += (SelectString.Length > 1) ? " and " + SelectString + " and a.pid=" + Session["ProjectCode"].ToString() : "";


            #endregion

            GridView1.DataBind();
        }
示例#20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CWID = SystemSet.GetRequestSet("CWid");
            string database = Session["DatabaseName"].ToString();

            //SqlDataSource1.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
            if ((Session["UserName"] == null) || (Session["CompanyName"] == null))
            {
                Response.Redirect("Login.aspx");
            }
            if (!IsPostBack)
            {
                Session["DataTable"] = null;
                string CWID1 = WebModel.SItemName(database, SQLStringEBg, "CWID");
                SQLStringCBg   = "Select  *  from CBudget_WBS where CWID=" + CWID1 + "";
                LbCNumber.Text = WebModel.SItemName(database, SQLStringCBg, "CNumber");

                string    SQLselect = "Select [PID],[LayerCode],[LayerNum],[UpperWID],[SortNum],[ItemOrder],[ItemName],[Unit],[ItemKind],[ENumber],[EUnitPrice],[ExecuteKind],[EEdition],[ResourceCode] from EBudget_WBS where pid=" + Session["ProjectCode"].ToString() + " and UpperWID=" + CWID;
                DataTable dt        = WebModel.LoadSetContentData(database, SQLselect);
                Session["DataTable"] = dt;
                Repeater1.DataSource = dt;
                Repeater1.DataBind();
            }
            LoadContent();
            if (Session["DataTable"] != null)
            {
                Repeater1.DataSource = (DataTable)Session["DataTable"];
            }
        }
示例#21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ID = (SystemSet.GetRequestSet("ID") != "") ? SystemSet.GetRequestSet("ID") : "";
     if (!IsPostBack)
     {
         LoadContent();
     }
 }
示例#22
0
        protected void Search_Click(object sender, ImageClickEventArgs e)
        {
            string Keyword = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TBSearch.Text));

            Sql = "SELECT [PriceID],[ItemName],REPLACE(Unit,' ','') as Unit,[Complex],[AnaNumber],[Code],[Price],[Notes],REPLACE(ItemKind,' ','') as ItemKind FROM [PrivateResource] WHERE ItemName like '%" + Keyword + "%' ";
            SqlDataSource2.SelectCommand = Sql;
            GridView1.DataBind();
        }
示例#23
0
文件: Notify.ashx.cs 项目: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string signature = context.Request["msg_signature"]; //签名串
            string timeStamp = context.Request["timestamp"];     //时间戳
            string nonce     = context.Request["nonce"];         //随机串
            string xml       = "";                               //解密后的xml字符串

            if (bll.DecryptMsg(signature, timeStamp, nonce, RequestXML(context).InnerXml, out xml))
            {
                Dictionary <string, string> parameters = bll.XmlToDictionary(xml);
                switch (parameters["InfoType"]) //信息类型
                {
                case "component_verify_ticket": //组件tiket
                    SystemSet systemSet = bll.GetSysSet();
                    systemSet.ComponentVerifyTicket = parameters["ComponentVerifyTicket"];
                    if (bll.Update(systemSet))
                    {
                        ToLog("接收component_verify_ticket成功");
                    }
                    break;

                case "authorized":    //授权成功通知
                    break;

                case "unauthorized":    //取消授权通知
                    var websiteInfoList = bll.GetList <WebsiteInfo>(string.Format(" AuthorizerAppId='{0}'", parameters["AuthorizerAppid"]));
                    if (websiteInfoList != null)
                    {
                        foreach (var website in websiteInfoList)
                        {
                            website.AuthorizerAppId        = "";
                            website.AuthorizerAccessToken  = "";
                            website.AuthorizerRefreshToken = "";
                            website.AuthorizerNickName     = "";
                            website.AuthorizerServiceType  = "";
                            website.AuthorizerVerifyType   = "";
                            website.AuthorizerUserName     = "";
                            bll.Update(website);
                        }
                    }

                    break;

                case "updateauthorized":    //授权更新通知
                    break;

                default:
                    break;
                }
            }
            else
            {
                context.Response.Write("fail");
                return;
            }
            context.Response.Write("success");
        }
示例#24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     SqlDataSource1.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
     if (SystemSet.GetRequestSet("RFQ_Code") != "")
     {
         SqlDataSource1.SelectCommand = "SELECT [Name], [Type], [Path], [UID] FROM [RFQ_File] where RFQ_Code ='" + SystemSet.GetRequestSet("RFQ_Code") + "' ORDER BY [UID]";
     }
     Loadcontent();
 }
示例#25
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Expires     = 0;
            string result = "false";

            try
            {
                userBll            = new BLLUser("");
                weixinBll          = new BLLWeixin("");
                this.juActivityBll = new BLLJuActivity("");
                this.systemSet     = this.juActivityBll.GetSysSet();
                string Action = context.Request["Action"];

                switch (Action)
                {
                case "QueryJuActivityForWapCommon":    //活动查询
                    result = QueryJuActivityForWapCommon(context);
                    break;

                case "QueryActivityListForSpreadRank":    //活动排名列表
                    result = QueryActivityListForSpreadRank(context);
                    break;

                case "QueryJuActivityForWap":
                    result = QueryJuActivityForWap(context);
                    break;

                case "AddJuActivityPraise":    //增加赞
                    result = AddJuActivityPraise(context);
                    break;

                //case "QueryJuMaster"://查询专家库
                //    result = QueryJuMaster(context);
                //    break;
                //case "QueryJuMasterFeedBack"://查询专家库留言//所有人可见
                //    result = QueryJuMasterFeedBack(context);
                //    break;
                //case "AddJuMasterUserLinkerInfo"://提交联系信息
                //    result = AddJuMasterUserLinkerInfo(context);
                //    break;
                //case "AddJuMasterFeedBack"://提交留言
                //    result = AddJuMasterFeedBack(context);
                //    break;
                case "QueryJuActivitySpreadRank":    //提交留言
                    result = QueryJuActivitySpreadRank(context);
                    break;
                }
            }
            catch (Exception ex)
            {
                result = ex.Message;
            }

            context.Response.Write(result);
        }
示例#26
0
        static void Main()
        {
            var entities = new EntitySet();
            var screen   = new ScreenConfig(32, 32);
            var systems  = new SystemSet();

            systems.Add(new DirectRenderSystem());
            systems.Add(new RenderToFileSystem(screen, new RenderToFileConfig("frame_{0}.png")));
            systems.UpdateOnce(entities);
        }
示例#27
0
        protected void BtnEdit_Click(object sender, EventArgs e)
        {
            string database = Session["DatabaseName"].ToString();
            //string _TableName = "Bid_Library";
            string AnaNumber = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxAnaNumber.Text));
            string Sql       = "update " + _TableName + " set AnaNumber=" + AnaNumber + " where PriceID= '" + Session["PriceID"].ToString() + "'";

            WebModel.SQLAction(database, Sql);
            ScriptManager.RegisterStartupScript((System.Web.UI.Page)HttpContext.Current.Handler, this.GetType(), "ShowMessage", "alert('已修改完成');", true);
        }
示例#28
0
        private void tsbSystemSet_Click(object sender, EventArgs e)
        {
            SystemSet s = new SystemSet();

            s.RefreshList += new EventHandler <EventArgs>(s_RefreshList);
            string str = this.tsslCurrent.Text;

            this.tsslCurrent.Text = "当前操作:系统配置";
            s.ShowDialog(this);
            this.tsslCurrent.Text = str;
        }
示例#29
0
        private void TitleSetForm_Load(object sender, EventArgs e)
        {
            SystemSet _set = new SystemSet();

            _set = Common.GlobalPrizeSystem.GetSystemSet();
            if (_set != null)
            {
                txtBoxTitle1.Text = _set.Title1;
                txtBoxTitle2.Text = _set.Title2;
            }
        }
示例#30
0
        public Dictionary <int, List <int> > mapPrizeInSet = null; //内定,你懂的
        #endregion

        #region 初始化

        public PrizeSystem()
        {
            this.mapPerson = new Dictionary <int, Person>();
            this.mapRank   = new Dictionary <int, Rank>();
            this.mapPrize  = new Dictionary <int, List <int> >();

            sysSet         = new SystemSet();
            imgPositionSet = new ImgPositionSet();

            mapPrizeInSet = new Dictionary <int, List <int> >();
        }