protected void Page_Load(object sender, EventArgs e) { lblCount.InnerText = Request.QueryString["Count"].ToString(); //OA.OAService oaservice=new OA.OAService(); //DataSet ds=oaservice.MSM_Select("1=1"); DataBase.DBService service = new DataBase.DBService(); string strSQLSelect="select * from(select top 1 OA_SMS.* from dbo.OA_SMS where Remind_Flag=0 and Delete_Flag=0 and TO_ID in"+ "(select ID from dbo.Power_Accounts where AcountName='" + strAccount + "') order by SMS_ID desc) as A left join OA_SMS_Body on OA_SMS_Body.Sms_BodyID=A.Body_ID"; DataSet ds = service.ExecSql(strSQLSelect); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { lblFrom.Text = ds.Tables[0].Rows[0]["From_ID"].ToString(); lblTime.Text = ds.Tables[0].Rows[0]["SendTime"].ToString(); lblContent.Text = ds.Tables[0].Rows[0]["Sms_Type"].ToString(); readlink.InnerText = ds.Tables[0].Rows[0]["sms_Content"].ToString(); string strUpdate = "Update OA_SMS set Remind_Flag=1 where SMS_ID=" + ds.Tables[0].Rows[0]["SMS_ID"].ToString(); service.ExecSql(strUpdate); //Response.Write("<script>window.open('../../OA/MSM/RealTimeMSM.aspx','_Alarm');</script>"); readlink.Attributes.Add("onclick", "window.open('" + ds.Tables[0].Rows[0]["ReMine_URL"].ToString() + "','_blank')"); spanLook.Attributes.Add("onclick", "GetURL('" + ds.Tables[0].Rows[0]["ReMine_URL"].ToString() + "')"); spanDelete.Attributes.Add("onclick", "GetURL('Delete.aspx?SMS_ID=" + ds.Tables[0].Rows[0]["SMS_ID"].ToString() + "');"); } else { Response.Write("<script>window.open('RealTimeMSM.aspx','_Alarm');</script>"); Response.Write("<script>window.close();</script>"); } }
protected void btnEncript_Click(object sender, EventArgs e) { DataBase.DBService dbservice = new DataBase.DBService(); DataSet ds = dbservice.ExecSql("select distinct USER_ID from OA_BBS_Comment"); if (ds != null) { foreach (DataRow dr in ds.Tables[0].Rows) { string strAccount = dr[0].ToString(); dbservice.ExecSql("Update OA_BBS_Comment set USER_ID='" + ShineKJ.Command.DESEncrypt.Encrypt(strAccount) + "' where USER_ID='" + strAccount + "'"); } } Response.Write("<script>alert('加密数据成功!');</script>"); Response.Write("<script>window.opener=null;window.close();</script>"); }
private void LoadInboxDate() { DataBase.DBService dbservice = new DataBase.DBService(); string strSql = String.Empty; string Box_ID = String.Empty; if (Request.QueryString["Box_ID"] == null) { Box_ID = "0"; tbSendBox.Style.Add("display", "none"); tbInbox.Style.Add("display", "none"); } else Box_ID = Request.QueryString["Box_ID"].ToString(); strSql = "select body_ID,A.ID,From_ID,TO_ID2,SUBJECT,[CONTENT],ATTACHMENT_ID,ATTACHMENT_NAME,SEND_TIME,IMPORTANT,READ_FLAG,ATTACHMENT_SIZE,TO_ID,COPY_TO_ID,COPY_TO_Name from(" + "select ID,body_ID,READ_FLAG from dbo.OA_Email where Box_ID=" + Box_ID + " and TO_ID=(select ID from dbo.Power_Accounts where AcountName='" + strAccount + "')" + ")as A left join dbo.OA_Email_Body on OA_Email_Body.ID=A.body_ID "; DataSet ds = dbservice.ExecSql(strSql); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { GridView1.DataSource = ds; GridView1.DataBind(); } else { DivNo.Style.Add("display", ""); divData.Style.Add("display", "none"); } }
private void Bind() { //SqlConnection sqlcon = new SqlConnection(@"server=X4\SQL2005;database=AllMineDigitize;uid=sa;pwd=x4"); string sql = "select PointName,PointPlace,pointvalue from MineMain_Value_view order by PointName"; sql += " select PointName,PointPlace,pointvalue from MineMain_switch_view"; //sql += " select station.StationNO,station.StationPlace" // + ",(select count(BlockAddress) from KJ128_RealTimeDistribution where StationNO=station.StationNO) as pcount" // + " from KJ128_RealTimeEquipmentState as station"; //// 风机 //sql += " select FanName,case FirstEngineState when 1 then '开' else '关' end as state from dbo.Fans_RealTime"; //SqlDataAdapter da = new SqlDataAdapter(sql, sqlcon); //DataSet ds = new DataSet(); //da.Fill(ds); DataBase.DBService db = new DataBase.DBService(); DataSet ds = db.ExecSql(sql); dlValue.DataSource = ds.Tables[0]; dlValue.DataBind(); dlSwitch.DataSource = ds.Tables[1]; dlSwitch.DataBind(); //dlPers.DataSource = ds.Tables[2]; //int icount = 0; //foreach (DataRow dr in ds.Tables[2].Rows) //{ // icount += Convert.ToInt32(dr["pcount"]); //} //lblPerSum.Text = " " + icount.ToString() + " 人"; //dlPers.DataBind(); //dlFans.DataSource = ds.Tables[3]; //dlFans.DataBind(); //gvValue.DataSource = //gvValue.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { DataBase.DBService service = new DataBase.DBService(); string strSQLSelect = "Update OA_SMS set Delete_Flag=1 where SMS_ID=" + Request.QueryString["SMS_ID"]; DataSet ds = service.ExecSql(strSQLSelect); Response.Write("<script>window.close();</script>"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hidID.Value = Request.QueryString["Box_ID"].ToString(); DataBase.DBService dbservice = new DataBase.DBService(); DataSet ds = dbservice.ExecSql("select * from OA_Email_Box where Box_ID=" + hidID.Value); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; txtName.Text = dr["Box_Name"].ToString(); txtNO.Text = dr["Box_NO"].ToString(); } else { Response.Write("<script>alert('加载数据失败');</script>"); Response.Write("<script>window.location.href='EmailBox.aspx';</script>"); } } }
/// <summary> /// 绑定到GridView /// </summary> private void BindGridView() { DataBase.DBService service = new DataBase.DBService(); DataSet ds = service.ExecSql("select A.*,AcountName from(select ID,To_ID,Read_Flag,Delete_Flag,Body_ID from OA_Email where body_ID=" + Request.QueryString["Body_ID"].ToString() + ") as A left join dbo.Power_Accounts on Power_Accounts.ID=A.To_ID "); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { divData.Style.Add("display",""); DivNo.Style.Add("display", "none"); //DivNo.Visible = false; // GridView绑定并显示数据 this.gdvFiles.DataSource = ds.Tables[0]; this.gdvFiles.DataBind(); } else { Response.Write("<script>window.open('Left.aspx','_EmailLeft');window.open('Sentbox.aspx','_Email');</script>"); divData.Style.Add("display", "none"); DivNo.Style.Add("display", ""); } }
private void LoadBoard() { DataBase.DBService dbservice = new DataBase.DBService(); DataSet ds = dbservice.ExecSql("select * from OA_BBS_Board where BOARD_ID="+hidID.Value); if (ds != null&&ds.Tables.Count>0&&ds.Tables[0].Rows.Count>0) { DataRow dr=ds.Tables[0].Rows[0]; isAnonymity.Value = dr["ANONYMITY_YN"].ToString().Equals("True") ? "1" : "0"; txtOwnID.Value = dr["BOARD_HOSTER"].ToString(); txtOwnName.Value = dr["BOARD_HOSTER_Name"].ToString(); txtName.Text = dr["BOARD_NAME"].ToString(); txtNO.Text = dr["BOARD_NO"].ToString(); txtUserID.Value = dr["USER_ID"].ToString(); txtUserName.Value = dr["User_Name"].ToString(); txtWelName.Text = dr["WELCOME_TEXT"].ToString(); txtDeptID.Value = dr["DEPT_ID"].ToString(); txtDeptName.Value = powerservice.Department_GetDeptNamestr(txtDeptID.Value); txtPrivID.Value = dr["PRIV_ID"].ToString(); txtPrivName.Value = powerservice.Private_GetPrivNames(txtPrivID.Value); } }
private void SendEmailAgain() { DataBase.DBService dbservice = new DataBase.DBService(); DataSet ds = dbservice.ExecSql("select '" + Server.UrlDecode( Request.QueryString["AccountName"].ToString()) + "' as AccountName,'" + Request.QueryString["AccountID"].ToString() + "' as AccountID, * from dbo.OA_Email_Body where ID=" + Request.QueryString["Body_ID"].ToString()); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { txtUserID.Value = ds.Tables[0].Rows[0]["AccountID"].ToString(); txtUserName.Value = ds.Tables[0].Rows[0]["AccountName"].ToString(); txtSubject.Text = ds.Tables[0].Rows[0]["SUBJECT"].ToString(); txtContent.Value = ds.Tables[0].Rows[0]["CONTENT"].ToString(); //加载附件 attachment_ID_OLD.Value = ds.Tables[0].Rows[0]["ATTACHMENT_ID"].ToString(); attachment_Name_OLD.Value = ds.Tables[0].Rows[0]["ATTACHMENT_NAME"].ToString(); attachment_Size_OLD.Value = ds.Tables[0].Rows[0]["ATTACHMENT_SIZE"].ToString(); AddAttent(); ckbIsMSM.Checked = bool.Parse(ds.Tables[0].Rows[0]["SMS_REMIND"].ToString()); //重要程度 int imp = int.Parse(ds.Tables[0].Rows[0]["IMPORTANT"].ToString()); if (imp == 1) rbtnNormal.Checked = true; else if (imp == 2) rbtnImp.Checked = true; else rbtnVerImp.Checked = true; string strCopyID = ds.Tables[0].Rows[0]["COPY_TO_ID"].ToString(); if (strCopyID.Trim().Equals(String.Empty)) { trCopy.Style.Add("display", "none"); readlink.InnerText = "添加抄送"; } else { trCopy.Style.Add("display", "block"); readlink.InnerText = "隐藏抄送"; txtCopyID.Value = strCopyID; txtCopyName.Value = ds.Tables[0].Rows[0]["COPY_TO_Name"].ToString(); } } btnBack.Visible = true; btnBack.Attributes.Add("onclick", "location='Sentbox.aspx';"); }
private void LoadTransf() { DataBase.DBService dbservice = new DataBase.DBService(); DataSet ds = dbservice.ExecSql("select * from OA_Email_Body where ID=" + Request.QueryString["transfBodyID"].ToString()); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { txtSubject.Text = "FW: " + (ds.Tables[0].Rows[0]["SUBJECT"].Equals("") ? "[无主题]" : ds.Tables[0].Rows[0]["SUBJECT"].ToString()); //加载附件 attachment_ID_OLD.Value = ds.Tables[0].Rows[0]["ATTACHMENT_ID"].ToString(); attachment_Name_OLD.Value = ds.Tables[0].Rows[0]["ATTACHMENT_NAME"].ToString(); attachment_Size_OLD.Value = ds.Tables[0].Rows[0]["ATTACHMENT_SIZE"].ToString(); AddAttent(); StringBuilder strContent = new StringBuilder(); strContent.Append("您好!<br />"); strContent.Append("<br />"); strContent.Append("<br />"); strContent.Append("========" + ds.Tables[0].Rows[0]["FROM_ID"].ToString() + "在" + ds.Tables[0].Rows[0]["SEND_TIME"].ToString() + "的来信中写道:========<br />"); strContent.Append(ds.Tables[0].Rows[0]["CONTENT"].ToString() + "<br />"); strContent.Append("=========================================<br />"); strContent.Append(" 致<br />"); strContent.Append(" 礼!"); txtContent.Value = strContent.ToString(); ckbIsMSM.Checked = bool.Parse(ds.Tables[0].Rows[0]["SMS_REMIND"].ToString()); //重要程度 int imp = int.Parse(ds.Tables[0].Rows[0]["IMPORTANT"].ToString()); if (imp == 1) rbtnNormal.Checked = true; else if (imp == 2) rbtnImp.Checked = true; else rbtnVerImp.Checked = true; } }
private void LoadReInfo() { DataBase.DBService dbservice = new DataBase.DBService(); DataSet ds = dbservice.ExecSql("select Power_Accounts.ID as accountID,SEND_TIME,FROM_ID,SUBJECT,[CONTENT] FROM OA_Email_Body left join dbo.Power_Accounts ON Power_Accounts.AcountName=OA_Email_Body.FROM_ID where OA_Email_Body.ID=" + Request.QueryString["reBodyID"].ToString()); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { txtUserID.Value = ds.Tables[0].Rows[0]["accountID"].ToString()+","; txtUserName.Value = ds.Tables[0].Rows[0]["FROM_ID"].ToString() + ","; txtSubject.Text = "Re: " + (ds.Tables[0].Rows[0]["SUBJECT"].Equals("") ? "[无主题]" : ds.Tables[0].Rows[0]["SUBJECT"].ToString()); StringBuilder strContent = new StringBuilder(); strContent.Append(ds.Tables[0].Rows[0]["FROM_ID"].ToString() + "您好!<br />"); strContent.Append("<br />"); strContent.Append("<br />"); strContent.Append("========" + ds.Tables[0].Rows[0]["FROM_ID"].ToString() + "在" + ds.Tables[0].Rows[0]["SEND_TIME"].ToString() + "的来信中写道:========<br />"); strContent.Append(ds.Tables[0].Rows[0]["CONTENT"].ToString() + "<br />"); strContent.Append("=========================================<br />"); strContent.Append(" 致<br />"); strContent.Append(" 礼!"); txtContent.Value = strContent.ToString(); } }
private void LoadData() { DataBase.DBService dbservice = new DataBase.DBService(); DataSet ds = dbservice.ExecSql("select * from OA_Email_Body where ID=" + Request.QueryString["Body_ID"].ToString()); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { txtUserID.Value = ds.Tables[0].Rows[0]["TO_ID"].ToString(); txtUserName.Value = ds.Tables[0].Rows[0]["TO_ID2"].ToString(); txtSubject.Text = ds.Tables[0].Rows[0]["SUBJECT"].ToString(); txtContent.Value = ds.Tables[0].Rows[0]["CONTENT"].ToString(); //加载附件 attachment_ID_OLD.Value = ds.Tables[0].Rows[0]["ATTACHMENT_ID"].ToString(); attachment_Name_OLD.Value = ds.Tables[0].Rows[0]["ATTACHMENT_NAME"].ToString(); attachment_Size_OLD.Value = ds.Tables[0].Rows[0]["ATTACHMENT_SIZE"].ToString(); AddAttent(); ckbIsMSM.Checked = bool.Parse(ds.Tables[0].Rows[0]["SMS_REMIND"].ToString()); //重要程度 int imp = int.Parse(ds.Tables[0].Rows[0]["IMPORTANT"].ToString()); if (imp == 1) rbtnNormal.Checked = true; else if (imp == 2) rbtnImp.Checked = true; else rbtnVerImp.Checked = true; string strCopyID = ds.Tables[0].Rows[0]["COPY_TO_ID"].ToString(); if (strCopyID.Trim().Equals(String.Empty)) { trCopy.Style.Add("display", "none"); readlink.InnerText = "添加抄送"; } else { trCopy.Style.Add("display", "block"); readlink.InnerText = "隐藏抄送"; txtCopyID.Value = strCopyID; txtCopyName.Value = ds.Tables[0].Rows[0]["COPY_TO_Name"].ToString(); } } }
private void ReadSendBox() { tbInbox.Style.Add("display", "none"); tbSendBox.Style.Add("display", ""); hidBodyID.Value = Request.QueryString["Body_ID"].ToString(); DataBase.DBService dbservice = new DataBase.DBService(); string strSql = String.Empty; strSql = "select ID,0,From_ID,TO_ID2,SUBJECT,[CONTENT],ATTACHMENT_ID,ATTACHMENT_NAME,SEND_TIME,IMPORTANT,'true',ATTACHMENT_SIZE ,TO_ID,COPY_TO_ID,COPY_TO_Name " +" from dbo.OA_Email_Body where From_ID='"+strAccount+"' and SEND_FLAG=1 "; DataSet ds = dbservice.ExecSql(strSql); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { GridView1.DataSource = ds; GridView1.DataBind(); } else { DivNo.Style.Add("display", ""); divData.Style.Add("display", "none"); } }