Exemple #1
0
        void Search_Show()
        {
            Utility.buildListBox(ddlPavilion.Items, "select paID,Name from Pavilion ", "paID", "Name", "请选择", "");

            string s;

            s           = Utility.GetParam("search");
            tbRoom.Text = s;

            s = Utility.GetParam("paID");
            try
            {
                ddlPavilion.SelectedIndex = ddlPavilion.Items.IndexOf(ddlPavilion.Items.FindByValue(s));
            }
            catch { }
        }
        private void Login_login_Click(object sender, System.EventArgs e)
        {
            if (Login_logged)
            {
                // Login Logout begin

                // Login OnLogout Event begin
                // Login OnLogout Event end
                Login_logged          = false;
                Session["UserID"]     = 0;
                Session["UserRights"] = 0;
                Login_Show();
                // Login Logout end
            }
            else
            {
                // Login Login begin
                int iPassed = Convert.ToInt32(Utility.Dlookup("members", "count(*)", "member_login ='******' and member_password='******'"));
                if (iPassed > 0)
                {
                    // Login OnLogin Event begin
                    // Login OnLogin Event end
                    //Login_message.Visible = false;

                    Session["UserID"] = Convert.ToInt32(Utility.Dlookup("members", "member_id", "member_login ='******' and member_password='******'"));
                    Login_logged      = true;

                    Session["UserRights"] = Convert.ToInt32(Utility.Dlookup("members", "security_level_id", "member_login ='******' and member_password='******'"));

                    string sQueryString = Utility.GetParam("querystring");
                    string sPage        = Utility.GetParam("ret_page");
                    if (!sPage.Equals(Request.ServerVariables["SCRIPT_NAME"]) && sPage.Length > 0)
                    {
                        Response.Redirect(sPage + "?" + sQueryString);
                    }
                    else
                    {
                        Response.Redirect(Login_FormAction);
                    }
                }
                else
                {
                    //Login_message.Visible = true;
                }
                // Login Login end
            }
        }
Exemple #3
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     // 在此处放置用户代码以初始化页面
     Utility = new CCUtility(this);
     Utility.CheckSecurity(2);
     if (!IsPostBack)
     {
         p_theID.Value = Utility.GetParam("ID");
         Page_Show(sender, e);
     }
 }
Exemple #4
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // 在此处放置用户代码以初始化页面
            Utility = new CCUtility(this);

            if (!IsPostBack)
            {
                theID.Value = Utility.GetParam("ID");
                InitDropDownList();

                if (theID.Value.Trim() != "")
                {
                    strSQL = "select * from shebei_mingxi where id=' " + theID.Value.Trim() + " '";
                    tb     = Utility.ExecuteSql4Ds(strSQL).Tables[0];
                    if (tb.Rows.Count > 0)
                    {
                        ControlDataBind();
                    }
                }
            }
        }
        private void btSave_Click(object sender, System.EventArgs e)
        {
            string sSQL         = "";
            string sWhere       = "";
            string p2_Name      = CCUtility.ToSQL(Utility.GetParam("tbName"), FieldTypes.Text);
            string p2_Area      = CCUtility.ToSQL(Utility.GetParam("tbArea"), FieldTypes.Text);
            string p2_High      = CCUtility.ToSQL(Utility.GetParam("tbHigh"), FieldTypes.Text);
            string p2_Layer     = CCUtility.ToSQL(Utility.GetParam("tbLayer"), FieldTypes.Text);
            string p2_BuildDate = CCUtility.ToSQL(Utility.GetParam("tbBuildDate"), FieldTypes.Text);
            string p2_Type      = CCUtility.ToSQL(Utility.GetParam("ddlTYpe"), FieldTypes.Number);
            string p2_Sunny     = CCUtility.ToSQL(Utility.GetParam("ddlSunny"), FieldTypes.Number);
            string p2_Memo      = CCUtility.ToSQL(Utility.GetParam("tbMemo"), FieldTypes.Text);

            if (tbName.Text.Trim() == "")
            {
                ShowErrMsg("请输入楼宇名称");
                return;
            }
            if (p_theID.Value.Length == 0)
            {
                int iCount = Utility.DlookupInt("pavilion", "count(*)", "Name=" + CCUtility.ToSQL(Utility.GetParam("tbName"), FieldTypes.Text));
                if (iCount != 0)
                {
                    ShowErrMsg(sErrMsg);
                    return;
                }

                sSQL = "insert into Pavilion ( " +
                       "name," +
                       "Area," +
                       "High," +
                       "Layer," +
                       "BuildDate," +
                       "Memo," +
                       "sunnyID," +
                       "typeID) " +
                       " values(" +
                       p2_Name + "," +
                       p2_Area + "," +
                       p2_High + "," +
                       p2_Layer + "," +
                       p2_BuildDate + "," +
                       p2_Memo + "," +
                       p2_Sunny + "," +
                       p2_Type + ")";
            }
            else
            {
                sWhere = " paID=" + CCUtility.ToSQL(p_theID.Value, FieldTypes.Number);
                int iCount = Utility.DlookupInt("pavilion", "count(*)", "Name=" + CCUtility.ToSQL(Utility.GetParam("tbName"), FieldTypes.Text) + " and not(" + sWhere + ")");
                if (iCount != 0)
                {
                    ShowErrMsg(sErrMsg);
                    return;
                }

                sSQL = " update Pavilion set " +
                       "[Name]=" + p2_Name +
                       ",[Area]=" + p2_Area +
                       ",[High]=" + p2_High +
                       ",[Layer]=" + p2_Layer +
                       ",[BuildDate]=" + p2_BuildDate +
                       ",[Memo]=" + p2_Memo +
                       ",[typeID]=" + p2_Type +
                       ",[sunnyID]=" + p2_Sunny;

                sSQL += " where " + sWhere;
            }
            SqlCommand cmd = new SqlCommand(sSQL, Utility.Connection);

            try
            {
                cmd.ExecuteNonQuery();
            }
            catch (Exception E)
            {
                ShowErrMsg(E.Message);
                return;
            }

            Response.Redirect(sFormAction);
        }
        private void btSave_Click(object sender, System.EventArgs e)
        {
            string sSQL       = "";
            string sWhere     = "";
            string p2_Name    = CCUtility.ToSQL(Utility.GetParam("btName"), FieldTypes.Text);
            string p2_AllName = CCUtility.ToSQL(Utility.GetParam("btAllName"), FieldTypes.Text);
            string p2_Note    = CCUtility.ToSQL(Utility.GetParam("btNote"), FieldTypes.Text);
            string p2_P1      = CCUtility.ToSQL(Utility.GetParam("btP1"), FieldTypes.Text);
            string p2_P2      = CCUtility.ToSQL(Utility.GetParam("btP2"), FieldTypes.Text);
            string p2_Phone   = CCUtility.ToSQL(Utility.GetParam("btPhone"), FieldTypes.Text);
            string p2_Memo    = CCUtility.ToSQL(Utility.GetParam("btMemo"), FieldTypes.Text);
            string p2_Type    = CCUtility.ToSQL(Utility.GetParam("ddl_Type"), FieldTypes.Number);

            if (p_theID.Value.Length == 0)
            {
                sSQL = "insert into AreaKK ( " +
                       "name," +
                       "allName," +
                       "Note," +
                       "MainPerson," +
                       "ContactPerson," +
                       "Phone," +
                       "Memo," +
                       "typeID) " +
                       " values(" +
                       p2_Name + "," +
                       p2_AllName + "," +
                       p2_Note + "," +
                       p2_P1 + "," +
                       p2_P2 + "," +
                       p2_Phone + "," +
                       p2_Memo + "," +
                       p2_Type + ")";
            }
            else
            {
                sWhere = " where ID=" + CCUtility.ToSQL(p_theID.Value, FieldTypes.Number);

                sSQL = " update AreaKK set " +
                       "[Name]=" + p2_Name +
                       ",[AllName]=" + p2_AllName +
                       ",[Note]=" + p2_Note +
                       ",[MainPerson]=" + p2_P1 +
                       ",[ContactPerson]=" + p2_P2 +
                       ",[Phone]=" + p2_Phone +
                       ",[Memo]=" + p2_Memo +
                       ",[typeID]=" + p2_Type;

                sSQL += sWhere;
            }
            SqlCommand cmd = new SqlCommand(sSQL, Utility.Connection);

            try
            {
                cmd.ExecuteNonQuery();
            }
            catch (Exception E)
            {
                ShowErrMsg(E.Message);
            }

            Response.Redirect(sFormAction);
        }
Exemple #7
0
        private void btSave_Click(object sender, System.EventArgs e)
        {
            string sSQL = "";
            string sWhere = "", sExist;

            string p2_NO     = CCUtility.ToSQL(Utility.GetParam("tbNO"), FieldTypes.Text);
            string p2_CarNO  = CCUtility.ToSQL(Utility.GetParam("tbCarNO"), FieldTypes.Text);
            string p2_Type   = CCUtility.ToSQL(Utility.GetParam("tbType"), FieldTypes.Text);
            string p2_Area   = CCUtility.ToSQL(Utility.GetParam("tbArea"), FieldTypes.Text);
            string p2_Place  = CCUtility.ToSQL(Utility.GetParam("tbPlace"), FieldTypes.Text);
            string p2_Master = CCUtility.ToSQL(Utility.GetParam("tbMaster"), FieldTypes.Text);
            string p2_Memo   = CCUtility.ToSQL(Utility.GetParam("tbMemo"), FieldTypes.Text);

            if (tbNO.Text.Trim() == "")
            {
                ShowErrMsg("请输入车位号.");
                return;
            }


            if (p_theID.Value.Length == 0)             //插入查询
            {
                sExist = "theNO=" + CCUtility.ToSQL(Utility.GetParam("tbNO"), FieldTypes.Text);

                int iCount = Utility.DlookupInt("CarBarn", "count(*)", sExist);
                if (iCount != 0)
                {
                    ShowErrMsg(sErrMsg);
                    return;
                }

                sSQL = "insert into Carbarn ( " +
                       "theNO," +
                       "carNO," +
                       "carType," +
                       "Area," +
                       "Place," +
                       "Master," +
                       "Memo) " +
                       " values(" +
                       p2_NO + "," +
                       p2_CarNO + "," +
                       p2_Type + "," +
                       p2_Area + "," +
                       p2_Place + "," +
                       p2_Master + "," +
                       p2_Memo + ")";
            }
            else
            {
                //查看车位是否已经存在
                sExist = "theNO=" + CCUtility.ToSQL(Utility.GetParam("tbNO"), FieldTypes.Text) +
                         " and ID<>" + CCUtility.ToSQL(p_theID.Value, FieldTypes.Number);

                int iCount = Utility.DlookupInt("Carbarn", "count(*)", sExist);
                if (iCount != 0)
                {
                    ShowErrMsg(sErrMsg);
                    return;
                }

                sWhere = " ID=" + CCUtility.ToSQL(p_theID.Value, FieldTypes.Number);

                sSQL = " update carbarn set " +
                       "[theNO]=" + p2_NO +
                       ",[carNO]=" + p2_CarNO +
                       ",[carType]=" + p2_Type +
                       ",[Area]=" + p2_Area +
                       ",[Place]=" + p2_Place +
                       ",[Master]=" + p2_Master +
                       ",[Memo]=" + p2_Memo;


                sSQL += " where " + sWhere;
            }
            SqlCommand cmd = new SqlCommand(sSQL, Utility.Connection);

            try
            {
                cmd.ExecuteNonQuery();
            }
            catch (Exception E)
            {
                ShowErrMsg(E.Message);
                return;
            }

            Back();            //Response.Redirect(sFormAction);
        }
Exemple #8
0
        private void btSave_Click(object sender, System.EventArgs e)
        {
            string sSQL = "";
            string sWhere = "", sExist;

            string p2_Login    = CCUtility.ToSQL(Utility.GetParam("tbLogin"), FieldTypes.Text);
            string p2_PassWord = CCUtility.ToSQL(Utility.GetParam("tbPassWord"), FieldTypes.Text);
            string p2_Name     = CCUtility.ToSQL(Utility.GetParam("tbName"), FieldTypes.Text);
            string p2_Level    = CCUtility.ToSQL(Utility.GetParam("ddl_Level"), FieldTypes.Number);
            string p2_Memo     = CCUtility.ToSQL(Utility.GetParam("tbMemo"), FieldTypes.Text);

            if (tbLogin.Text.Trim() == "")
            {
                ShowErrMsg("请输入登陆名.");
                return;
            }


            if (p_theID.Value.Length == 0)             //插入查询
            {
                sExist = "member_login="******"tbLogin"), FieldTypes.Text);

                int iCount = Utility.DlookupInt("Members", "count(*)", sExist);
                if (iCount != 0)
                {
                    ShowErrMsg(sErrMsg);
                    return;
                }

                sSQL = "insert into Members ( " +
                       "name," +
                       "member_login," +
                       "member_password," +
                       "security_level_id," +
                       "Memo) " +
                       " values(" +
                       p2_Name + "," +
                       p2_Login + "," +
                       p2_PassWord + "," +
                       p2_Level + "," +

                       p2_Memo + ")";
            }
            else
            {
                //查看车位是否已经存在
                sExist = "member_login="******"tbLogin"), FieldTypes.Text) +
                         " and member_id<>" + CCUtility.ToSQL(p_theID.Value, FieldTypes.Number);

                int iCount = Utility.DlookupInt("Members", "count(*)", sExist);
                if (iCount != 0)
                {
                    ShowErrMsg(sErrMsg);
                    return;
                }

                sWhere = " member_id=" + CCUtility.ToSQL(p_theID.Value, FieldTypes.Number);

                sSQL = " update members set " +
                       "[name]=" + p2_Name +
                       ",[member_login]=" + p2_Login +
                       ",[member_password]=" + p2_PassWord +
                       ",[security_level_id]=" + p2_Level +
                       ",[Memo]=" + p2_Memo;


                sSQL += " where " + sWhere;
            }
            SqlCommand cmd = new SqlCommand(sSQL, Utility.Connection);

            try
            {
                cmd.ExecuteNonQuery();
            }
            catch (Exception E)
            {
                ShowErrMsg(E.Message);
                return;
            }

            Back();            //Response.Redirect(sFormAction);
        }
        private void btSave_Click(object sender, System.EventArgs e)
        {
            string sSQL = "";
            string sWhere = "", sExist;
            string p2_paID  = CCUtility.ToSQL(paID.Value, FieldTypes.Number);
            string p2_Room  = CCUtility.ToSQL(Utility.GetParam("tbRoom"), FieldTypes.Text);
            string p2_Area  = CCUtility.ToSQL(Utility.GetParam("tbArea"), FieldTypes.Text);
            string p2_Area2 = CCUtility.ToSQL(Utility.GetParam("tbArea2"), FieldTypes.Text);
            string p2_Layer = CCUtility.ToSQL(Utility.GetParam("tbLayer"), FieldTypes.Text);
            string p2_Cell  = CCUtility.ToSQL(Utility.GetParam("ddlCell"), FieldTypes.Number);
            string p2_Type  = CCUtility.ToSQL(Utility.GetParam("ddlTYpe"), FieldTypes.Number);
            string p2_Sunny = CCUtility.ToSQL(Utility.GetParam("ddlSunny"), FieldTypes.Number);
            string p2_Memo  = CCUtility.ToSQL(Utility.GetParam("tbMemo"), FieldTypes.Text);

            string p2_ClientName = CCUtility.ToSQL(Utility.GetParam("tbClientName"), FieldTypes.Text);
            string p2_ClientID   = CCUtility.ToSQL(Utility.GetParam("tbClientID"), FieldTypes.Text);
            string p2_UseDate    = CCUtility.ToSQL(Utility.GetParam("tbUseDate"), FieldTypes.Text);
            string p2_Phone      = CCUtility.ToSQL(Utility.GetParam("tbPhone"), FieldTypes.Text);
            string p2_ClientCard = CCUtility.ToSQL(Utility.GetParam("tbClientCard"), FieldTypes.Text);
            string p2_Unit       = CCUtility.ToSQL(Utility.GetParam("tbUnit"), FieldTypes.Text);



            if (tbRoom.Text.Trim() == "")
            {
                ShowErrMsg("请输入房间名称");
                return;
            }

            if (tbPaName.Text.Trim() == "")
            {
                ShowErrMsg("请输入楼宇名称");
                return;
            }

            if (p_theID.Value.Length == 0) //插入查询
            {
                sExist = "hoRoom=" + CCUtility.ToSQL(Utility.GetParam("tbRoom"), FieldTypes.Text) +
                         " and paID<>" + p2_paID;

                int iCount = Utility.DlookupInt("House", "count(*)", sExist);
                if (iCount != 0)
                {
                    ShowErrMsg(sErrMsg);
                    return;
                }

                sSQL = "insert into House ( " +
                       "paID," +
                       "hoRoom," +
                       "hoFloor," +
                       "hoArchArce," +
                       "hoUseArce," +
                       "cellID," +
                       "sunnyId," +
                       "indoorID," +
                       "Memo," +
                       "CLIENT_NAME," +
                       "CLIENT_CARD," +
                       "CLIENT_ACCOUNT_NUMBER," +
                       "COMPANY_NAME," +
                       "CLIENT_PHONE," +
                       "USE_DATE) " +
                       " values(" +
                       p2_paID + "," +
                       p2_Room + "," +
                       p2_Layer + "," +
                       p2_Area + "," +
                       p2_Area2 + "," +
                       p2_Cell + "," +
                       p2_Sunny + "," +
                       p2_Type + "," +
                       p2_Memo + "," +
                       p2_ClientName + "," +
                       p2_ClientID + "," +
                       p2_ClientCard + "," +
                       p2_Unit + "," +
                       p2_Phone + "," +
                       p2_UseDate + ")";
            }
            else
            {
                //查看房间是否已经存在A
                sExist = "hoRoom=" + CCUtility.ToSQL(Utility.GetParam("tbRoom"), FieldTypes.Text) +
                         " and paID<>" + p2_paID +
                         " and hoID<>" + CCUtility.ToSQL(p_theID.Value, FieldTypes.Number);
                int iCount = Utility.DlookupInt("House", "count(*)", sExist);
                if (iCount != 0)
                {
                    ShowErrMsg(sErrMsg);
                    return;
                }

                sWhere = " hoID=" + CCUtility.ToSQL(p_theID.Value, FieldTypes.Number);

                sSQL = " update House set " +
                       "[hoRoom]=" + p2_Room +
                       ",[hoFloor]=" + p2_Layer +
                       ",[hoArchArce]=" + p2_Area +
                       ",[hoUseArce]=" + p2_Area2 +
                       ",[cellID]=" + p2_Cell +
                       ",[sunnyId]=" + p2_Sunny +
                       ",[IndoorID]=" + p2_Type +
                       ",[Memo]=" + p2_Memo +
                       ",[Client_Name]=" + p2_ClientName +
                       ",[CLIENT_CARD]=" + p2_ClientID +
                       ",[CLIENT_ACCOUNT_NUMBER]=" + p2_ClientCard +
                       ",[COMPANY_NAME]=" + p2_Unit +
                       ",[CLIENT_PHONE]=" + p2_Phone +
                       ",[USE_DATE]=" + p2_UseDate;

                sSQL += " where " + sWhere;
            }
            SqlCommand cmd = new SqlCommand(sSQL, Utility.Connection);

            try
            {
                cmd.ExecuteNonQuery();
            }
            catch (Exception E)
            {
                ShowErrMsg(E.Message);
                return;
            }

            Back();//Response.Redirect(sFormAction);
        }