//提交 protected void Button1_Click(object sender, EventArgs e) { string sid = txtid.Text.Trim(); if (sid == "") { sid = "-1"; } DataTable table = com.COM_Select("OA_ItemTB", "Id", "", sid, "", 4); if (table.Rows.Count != 0) { DataRow dr = table.Rows[0]; dr["typeid"] = typeid.SelectedValue.ToString(); dr["titlename"] = titlename.Text.Trim(); com.COM_Up(table, "OA_ItemTB", "typeid=@typeid,titlename=@titlename", sid); ok.Text = "修改成功!"; } else { table.Rows.Clear(); DataRow dr = table.NewRow(); dr["typeid"] = typeid.SelectedValue.ToString(); dr["titlename"] = titlename.Text.Trim(); table.Rows.Add(dr); com.COM_Add(table, "OA_ItemTB", "@typeid,@titlename"); ok.Text = "添加成功!"; } show(); txtid.Text = ""; titlename.Text = ""; }
public string getstrobj(object name, int i) { Daiv_OA.BLL.COMDLL com = new Daiv_OA.BLL.COMDLL(); string str = ""; if (i == 1) { DataTable dt = com.COM_Select("OA_ItemTB", "id", "", name.ToString(), "", 4); if (dt.Rows.Count != 0) { str = dt.Rows[0]["titlename"].ToString(); } } else { if (name.ToString() == "1") { str = "一般"; } else if (name.ToString() == "2") { str = "紧急"; } else { str = "十分紧急"; } } return(str); }
protected void Page_Load(object sender, EventArgs e) { User_Load("login"); if (!IsPostBack) { string id = com.getsid("id"); if (id != "-1") { DataTable table = com.COM_Select("OA_ItemTB", "Id", "", id, "", 4); if (table.Rows.Count != 0) { titlename.Text = table.Rows[0]["titlename"].ToString(); } } } }
protected void Button1_Click(object sender, EventArgs e) { string sid = com.getsid("id"); string names = new Daiv_OA.UI.BasicPage().getvalue(2); if (sid != "-1") { string uid = "0"; DataTable dt = com.COM_Select("OA_Task", "Tlid", "", sid, "", 4); if (dt.Rows.Count != 0) { string uname = dt.Rows[0]["Manager"].ToString(); DataTable dts = com.COM_Select("OA_User", "Uname", "", uname, "", 4); if (dts.Rows.Count != 0) { uid = dts.Rows[0]["Uid"].ToString(); } } new Daiv_OA.BLL.TaskBLL().UpworkprogressTs(Workprogress.SelectedValue.ToString(), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), titlename.Text, Convert.ToInt32(sid)); switch (Workprogress.SelectedValue.ToString()) { case "5": Daiv_OA.BLL.OA_SysMessageIn.ADDsysMessage(5, "," + uid + ",", "请求任务验收", names + "提前完成了任务请您验收", "TastCheck.aspx?tast=45678"); break; case "6": Daiv_OA.BLL.OA_SysMessageIn.ADDsysMessage(5, "," + uid + ",", "请求任务验收", names + "完成了任务请您验收", "TastCheck.aspx?tast=45678"); break; case "7": Daiv_OA.BLL.OA_SysMessageIn.ADDsysMessage(5, "," + uid + ",", "请求任务验收", names + "未按时完成了任务阅读详细", "TastCheck.aspx?tast=45678"); break; case "8": Daiv_OA.BLL.OA_SysMessageIn.ADDsysMessage(8, "," + uid + ",", "请求任务验收", names + "申请工作协调新时间急需您安排新时间", "TastCheck.aspx?tast=45678"); break; case "9": Daiv_OA.BLL.OA_SysMessageIn.ADDsysMessage(5, "," + uid + ",", "请求任务验收", names + "拒收了您安排的任务阅读详细", "TastCheck.aspx?tast=9"); break; } } Response.Write("<script>parent.location.href='My_Task_List.aspx'</script>"); }
protected void drop() { Daiv_OA.BLL.COMDLL com = new Daiv_OA.BLL.COMDLL(); Itemid.DataSource = com.COM_Select("OA_ItemTB", "typeid", "parentid", "1", "0", 8); Itemid.DataTextField = "titlename"; Itemid.DataValueField = "Id"; Itemid.DataBind(); }
protected void drop() { Daiv_OA.BLL.COMDLL com = new Daiv_OA.BLL.COMDLL(); dropitem.DataSource = com.COM_Select("OA_ItemTB", "typeid", "parentid", "1", "0", 8); dropitem.DataTextField = "titlename"; dropitem.DataValueField = "Id"; dropitem.DataBind(); dropitem.Items.Insert(0, new ListItem("======全部项目======", "0")); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { sid = com.getsid("address").ToString(); DataTable dt = com.COM_Select("OA_Address", "Id", "", sid, "", 4); DataRow dr; if (sid != "-1") { dr = dt.Rows[0]; drs(dr); com.COM_Up(dt, "OA_Address", "truename=@truename,phones=@phones,telephone=@telephone,email=@email,qq=@qq,Pids=@Pids", sid); } else { dr = dt.NewRow(); drs(dr); dt.Rows.Add(dr); com.COM_Add(dt, "OA_Address", "@truename,@phones,@telephone,@email,@qq,@Pids"); } go(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataDp(); string id = com.getsid("Ponid"); if (id != "-1") { DataTable table = com.COM_Select("OA_PersonalTB", "Id", "", id, "", 4); if (table.Rows.Count != 0) { titlename.Text = table.Rows[0]["note"].ToString(); string[] str = table.Rows[0]["inserttime"].ToString().Split("-".ToCharArray()); //txtBegintime.Text=table.Rows[0]["inserttime"].ToString(); DropY.SelectedValue = str[0].ToString(); DropM.SelectedValue = str[1].ToString(); DropD.SelectedValue = str[2].ToString(); } } } }
/// <summary> /// 提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button2_Click(object sender, EventArgs e) { string sid = com.getsid("sques"); DataTable dt = com.COM_Select("OA_QuestionTB", "Id", "", sid, "", 4); if (sid != "-1") { string user = getvalue(2); string u = dt.Rows[0]["quuser"].ToString(); if (user != u) { antime.Text = DateTime.Now.ToString(); } else { uptime.Text = DateTime.Now.ToString(); } DataRow dr = dt.Rows[0]; DR(dr); com.COM_Up(dt, "OA_QuestionTB", Daiv_OA.BLL.Component.UpQuestion, sid); FinalMessage("提交成功!", "Squestion.aspx", 0); } else { if (getvalue(2) != touser.SelectedValue.ToString()) { quuser.Text = getvalue(2); inserttime.Text = DateTime.Now.ToString(); dt.Rows.Clear(); DataRow dr = dt.NewRow(); DR(dr); dt.Rows.Add(dr); com.COM_Add(dt, "OA_QuestionTB", Daiv_OA.BLL.Component.InQuestion); FinalMessage("提交成功!", "Squestion.aspx", 0); } else { Tools.Common.JavaScript.MessageBox(this, "当前解决人和发布人不能同时存在!"); } } }
void show() { Daiv_OA.BLL.COMDLL com = new Daiv_OA.BLL.COMDLL(); DataTable table = com.COM_Select("OA_Message", "Mid", "", mes.ToString(), "", 4); if (table.Rows.Count != 0) { ren.Visible = false; } else { ren.Visible = true; drop(); } }
protected void SHgvlist() { gvlist.DataSource = com.COM_Select("OA_ItemTB", "typeid", "", "0", "", 7); gvlist.DataBind(); }
protected void gvlist_RowDataBound(object sender, GridViewRowEventArgs e) { int num = 0; // if (e.Row.RowIndex != -1) { int id = e.Row.RowIndex + 1; e.Row.Cells[0].Text = id.ToString(); } if (e.Row.RowType == DataControlRowType.DataRow) { #region 行事件 string fid = gvlist.DataKeys[e.Row.RowIndex].Value.ToString().Trim(); GridView gvlist3 = (GridView)e.Row.FindControl("GridView2"); if (fid != "") { Daiv_OA.BLL.COMDLL com = new Daiv_OA.BLL.COMDLL(); DataTable dt = com.COM_Select("OA_ItemTB", "parentid", "Isdelete", fid, "1", 8); gvlist3.DataSource = dt; gvlist3.DataBind(); if (com.getsid("uid") != "-1" && com.getsid("kq") != "-1") { DataTable ds = com.COM_Proc_Sel3("Pc_SelOpposebyPTI", fid, com.getsid("uid"), com.getsid("kq")); for (int i = 0; i < ds.Rows.Count; i++) { Label lb = (Label)gvlist3.Rows[i].FindControl("lbtxt"); switch (getvalue(4)) { case "1": lb.Text = ds.Rows[i]["threescore"].ToString(); break; case "2": lb.Text = ds.Rows[i]["twoscore"].ToString(); break; case "3": lb.Text = ds.Rows[i]["onescore"].ToString(); break; case "4": lb.Text = ds.Rows[i]["custom"].ToString(); break; } num += Convert.ToInt32(lb.Text.Trim()); TextBox txt = (TextBox)gvlist3.Rows[i].FindControl("txtremark"); txt.Text = ds.Rows[i]["remrk"].ToString(); } } } #endregion Label lbtxt = (Label)e.Row.FindControl("labnum"); lbtxt.Text = num.ToString(); Snum += num; } // 合计 if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[3].Text = "合计您给的总分:<font style=\"color:red\">" + Snum.ToString() + "</font>"; } }
/// <summary> /// 统计打分 /// </summary> /// <param name="c">当前角色打的总分</param> protected void Stats(int c) { DataTable dt = com.COM_Proc_Sel1("PC_SelOpenTB", "2"); if (dt.Rows.Count == 0) { Tools.Common.JavaScript.MessageBox(this, "统计最终分的公式设置有误!请联系管理员"); } else { string[] str = dt.Rows[0]["formula"].ToString().Split(",".ToCharArray()); dt = com.COM_Select("OA_StatsTB", "uid", "statstime", ddlUname.SelectedValue.ToString(), intime, 9); if (dt.Rows.Count != 0) { string sid = dt.Rows[0]["Id"].ToString(); double sum = Convert.ToDouble(dt.Rows[0]["Sendscore"].ToString()); DataRow dr = dt.Rows[0]; string column = ""; double d = sum; switch (pids) { case 1: dr["Sthreescore"] = c; column = "Sthreescore=@Sthreescore"; d += (Convert.ToInt32(str[2].ToString()) * c * 0.01); break; case 2: dr["Stwoscore"] = c; column = "Stwoscore=@Stwoscore"; d += (Convert.ToInt32(str[2].ToString()) * c * 0.01); break; case 3: dr["Sonescore"] = c; column = "Sonescore=@Sonescore"; d += (Convert.ToInt32(str[2].ToString()) * c * 0.01); break; case 4: dr["Scustom"] = c; column = "Scustom=@Scustom"; d += (Convert.ToInt32(str[2].ToString()) * c * 0.01); break; } dr["Sendscore"] = d; com.COM_Up(dt, "OA_StatsTB", column + ",Sendscore=@Sendscore", sid); } else { dt.Rows.Clear(); DataRow dr = dt.NewRow(); dr["Openid"] = 1; dr["uid"] = ddlUname.SelectedValue; dr["statstime"] = intime; string column = ""; double d = 0; switch (pids) { case 1: dr["Sthreescore"] = c; column = "@Sthreescore"; d = (Convert.ToInt32(str[3].ToString()) * c * 0.01); break; case 2: dr["Stwoscore"] = c; column = "@Stwoscore"; d = (Convert.ToInt32(str[2].ToString()) * c * 0.01); break; case 3: dr["Sonescore"] = c; column = "@Sonescore"; d = (Convert.ToInt32(str[2].ToString()) * c * 0.01); break; case 4: dr["Scustom"] = c; column = "@Scustom"; d = (Convert.ToInt32(str[2].ToString()) * c * 0.01); break; } dr["Sendscore"] = d; dt.Rows.Add(dr); com.COM_Add(dt, "OA_StatsTB", "@Openid,@uid,@statstime," + column + ",@Sendscore"); } } }