protected void Save_Click(object Sender, EventArgs E) { //评分等级必须为是 if (bd.CheckRepeat("SELECT xmid FROM HR_Kpdf_Pfxm WHERE XMID='" + ssxmid.SelectedValue + "' AND PFDJ='否'") == "true") { mydb.Alert("保存失败,该项目未设置评分等级,不能参与评分!"); return; } //评分项目判断(重复) if (bd.CheckRepeat("SELECT aid FROM HR_Kpdf_Bkpr02 WHERE SSBID='" + hkdb.GetStr(bid.Text) + "' AND SSXMID='" + ssxmid.SelectedValue + "'") == "true") { mydb.Alert("保存失败,该评分项目已存在!"); return; } SqlHelper.ExecuteSql("INSERT INTO HR_Kpdf_Bkpr02(SSBID,SSXMID,FZ,KPXZ,PFDJ_Y,PFDJ_L,PFDJ_Z,PFDJ_C,CJR,CJSJ) VALUES" + "('" + hkdb.GetStr(bid.Text) + "','" + ssxmid.SelectedValue + "', '" + hkdb.GetStr(fz.Text) + "', '" + hkdb.GetStr(kpxz.Text) + "', '" + hkdb.GetStr(pfdj_y.Text) + "', '" + hkdb.GetStr(pfdj_l.Text) + "', '" + hkdb.GetStr(pfdj_z.Text) + "', '" + hkdb.GetStr(pfdj_c.Text) + "','" + this.Session["UserID"] + "',GETDATE())"); ssxmid.SelectedValue = ""; fz.Text = ""; pfdj_y.Text = ""; pfdj_l.Text = ""; pfdj_z.Text = ""; pfdj_c.Text = ""; kpxz.Text = ""; mydb.Alert_Refresh("保存成功!", "Bkpr.aspx"); GridViewBind(); }
protected void Save_Click(object Sender, EventArgs E) { if (lbltitle.Text == "新增") { //编码判断(重复) if (bd.CheckRepeat("SELECT bid FROM HR_Kpdf_Bkpr01 WHERE bid='" + hkdb.GetStr(bid.Text) + "'") == "true") { mydb.Alert("保存失败,此编码已经存在!"); return; } SqlHelper.ExecuteSql("INSERT INTO HR_Kpdf_Bkpr01(bid,xm,bs,gw,fgzrid,fgzrmc,bz,cjr,cjsj) VALUES" + "('" + hkdb.GetStr(bid.Text) + "','" + hkdb.GetStr(xm.Text) + "','" + hkdb.GetStr(bs.Text) + "','" + hkdb.GetStr(gw.Text) + "','" + hkdb.GetStr(fgzrid.Text) + "','" + hkdb.GetStr(fgzrmc.Text) + "','" + hkdb.GetStr(bz.Text) + "','" + this.Session["userid"] + "',GETDATE())"); //判断btn Button btn = (Button)Sender; string s = btn.ID; if (s == "SaveAddBtn") { Clear_Click(); mydb.Alert_Refresh("保存成功,请新增下一条记录!", "Bkpr.aspx"); } else { mydb.Alert_Refresh("保存成功!", "Bkpr.aspx"); } } else { SqlHelper.ExecuteSql("UPDATE HR_Kpdf_Bkpr01 SET bs='" + hkdb.GetStr(bs.Text) + "',gw='" + hkdb.GetStr(gw.Text) + "',fgzrid='" + hkdb.GetStr(fgzrid.Text) + "',fgzrmc='" + hkdb.GetStr(fgzrmc.Text) + "',bz='" + hkdb.GetStr(bz.Text) + "',xgr='" + this.Session["userid"] + "',xgsj=GETDATE() WHERE BID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); mydb.Alert_Refresh("保存成功!", "Bkpr.aspx"); } }
//保存 protected void Save_Click(object sender, EventArgs e) { if (ynqd1.Checked == false && ynqt1.Checked == false && ynqd2.Checked == false && ynqt2.Checked == false && ynqd3.Checked == false && ynqt3.Checked == false) { mydb.Alert("签到类型必须至少选择一项!"); return; } //同一日期只能存在一条记录,不能重复 string sql = "SELECT sid FROM OA_KQ_SM01 WHERE Sqrid = '" + this.Session["UserID"] + "' AND qdsj='" + hkdb.GetStr(qdsj.Text) + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("您在该日期下已提交过考勤说明记录,不能重复!\\n请在原考勤说明记录上直接修改并保存后,重新送审即可!"); return; } //更新数据库 IDlabel.Text = Convert.ToString(SqlHelper.ExecuteScalar("INSERT INTO OA_KQ_SM01(QDSJ,YNQD1,YNQT1,YNQD2,YNQT2,YNQD3,YNQT3,KQQKSM,SMZT,SQRID,SQRMC,SQBMID,SQBMMC,SQSJ,jsrIDs,jsrNames,SMFJ) VALUES('" + hkdb.GetStr(qdsj.Text) + "','" + hkdb.GetValueChk_Str(ynqd1.Checked) + "','" + hkdb.GetValueChk_Str(ynqt1.Checked) + "','" + hkdb.GetValueChk_Str(ynqd2.Checked) + "','" + hkdb.GetValueChk_Str(ynqt2.Checked) + "','" + hkdb.GetValueChk_Str(ynqd3.Checked) + "','" + hkdb.GetValueChk_Str(ynqt3.Checked) + "','" + hkdb.GetStr(kqqksm.Text) + "','录入','" + this.Session["userid"] + "','" + this.Session["username"] + "','" + this.Session["deptid"] + "','" + this.Session["deptname"] + "',GETDATE(),'" + jsr.SelectedValue + "','" + jsr.SelectedItem.Text + "','" + hkdb.GetStr(Number.Text) + "')" + "select cast(scope_identity() as int)")); mydb.Alert_Refresh("保存成功!", "Kqsmlr.aspx"); SaveBtn.Visible = false; SendBtn.Visible = true; }
protected void Del_Click(object sender, EventArgs e) { string sql = "SELECT * FROM HK_NETDISK_DIR WHERE ParentID='" + hkdb.GetStr(mlid.Text) + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("删除失败,该文件夹下存在子文件夹!"); return; } SqlHelper.ExecuteSql("DELETE FROM HK_NETDISK_DIR WHERE DirID = '" + hkdb.GetStr(mlid.Text) + "'"); mydb.Alert_Close("删除成功!"); //刷新 Response.Write("<script language=javascript>"); Response.Write("window.parent.lframe10109.location='folder_l.aspx';<"); Response.Write("/script>"); mlid.Text = ""; mlmc.Text = ""; share.Checked = false; DropDownListBind(); DirList.SelectedValue = "0"; SaveBtn.Enabled = false; DelBtn.Enabled = false; }
protected void Page_Load(object sender, EventArgs e) { //PageTitle.Text = Convert.ToString(SqlHelper.ExecuteScalar("SELECT ProduName + Version FROM hk_Init WHERE ProduID='O'")); //Window1.Title = PageTitle.Text + "_系统登录"; if (!IsPostBack) { //验证码 LoadData(); //测试 string sql = "SELECT paramt FROM hk_CSDA WHERE paramt='P_sdate' AND p_string='0'"; if (bd.CheckRepeat(sql) == "true") { lblCs.Text = SqlHelper.ExecuteScalar("SELECT DemoText1 FROM hk_Init WHERE ProduID='O'").ToString(); lblCs.Visible = true; } //流程自动结束 SqlDataReader datar = SqlHelper.ExecuteReader("SELECT paramt FROM hk_CSDA WHERE paramt='P_sdate' AND p_string<>'0'"); if (datar.Read()) { SqlHelper.ExecuteSql("Update hk_Work Set wStatus='自动结束',wUserIDs='自动结束',wUserNames='自动结束',LastTime=GETDATE() where datediff(hh,LastTime,getdate())>TimeLimit and wStatus='正在办理'"); } datar.Close(); } else { Response.Cookies["haoke"].Expires = new DateTime(2020, 1, 1); } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { hkdb.PassTo("10109", "0"); AspNetPager1.PageSize = int.Parse(Request.Cookies["haoke"].Values["pagecount"]); //判断文件夹 string sql = "SELECT * FROM hk_NetDisk_Dir WHERE UserID='" + this.Session["userid"] + "'"; if (bd.CheckRepeat(sql) == "true") { DelBtn.Enabled = true; //UpBtn.Enabled = true; DropDownListBind(); GridViewBind(); } else { DelBtn.Enabled = false; //UpBtn.Enabled = false; } } }
protected void Save_Click(object sender, EventArgs e) { string kqspry1Str = hkdb.GetValueChk_Str(kqspry1.Checked); string kqspry2Str = hkdb.GetValueChk_Str(kqspry2.Checked); string kqspry3Str = hkdb.GetValueChk_Str(kqspry3.Checked); string kqglryStr = hkdb.GetValueChk_Str(kqglry.Checked); string tskqryStr = hkdb.GetValueChk_Str(tskqry.Checked); string ynnjtjStr = hkdb.GetValueChk_Str(ynnjtj.Checked); //Demo if (hkdb.IsDemo("Y") == "true") { return; } //判断考勤ID(重复) string sql = "SELECT YHID FROM OA_KQ_QX WHERE KQID = '" + hkdb.GetStr(kqid.Text) + "' AND YHID<>'" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("该考勤ID已有员工使用,不能重复!"); return; } SqlHelper.ExecuteSql("DELETE FROM OA_KQ_QX WHERE YHID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); SqlHelper.ExecuteSql("INSERT INTO OA_KQ_QX(YHID,KQSPRY1,KQSPRY2,KQSPRY3,KQGLRY,KQID,TSKQRY,Ynnjtj) VALUES('" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "','" + kqspry1Str + "','" + kqspry2Str + "','" + kqspry3Str + "','" + kqglryStr + "','" + hkdb.GetStr(kqid.Text) + "','" + tskqryStr + "','" + ynnjtjStr + "')"); SqlHelper.ExecuteSql("UPDATE YH SET UI_RZRQ='" + hkdb.GetStr(ui_rzrq.Text) + "' WHERE UI_ID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); mydb.Alert_Refresh_Close("保存成功!", "Qxwh.aspx"); }
//单个添加 protected void Save_Click(object Sender, EventArgs E) { //被考评人明细(重复) if (bd.CheckRepeat("SELECT mxid FROM HR_Kpdf_Kpxm02 WHERE SSKPID='" + hkdb.GetStr(kpid.Text) + "' AND SSBID='" + ssbid.SelectedValue + "'") == "true") { mydb.Alert("保存失败,该被考评人已在当前项目中存在!"); return; } SqlHelper.ExecuteSql("INSERT INTO HR_Kpdf_Kpxm02(sskpid,ssbid,ssxmid,ssxmmc,sjxmid,sjxmmc,Fz,Kpxz,Pfdj_y,Pfdj_l,Pfdj_z,PFDJ_C) SELECT '" + hkdb.GetStr(kpid.Text) + "',A.ssbid,A.ssxmid,B.XMMC,B.UPID,(SELECT XMMC FROM HR_Kpdf_Pfxm WHERE xmid=B.upid)AS sjxmmc,A.Fz,A.Kpxz,A.Pfdj_y,A.Pfdj_l,A.Pfdj_z,A.PFDJ_C FROM HR_Kpdf_Bkpr02 A LEFT OUTER JOIN HR_Kpdf_Pfxm B ON(A.SSXMID=B.XMID) WHERE A.ssbid='" + ssbid.SelectedValue + "'"); ssbid.SelectedValue = ""; mydb.Alert_Refresh("保存成功!", "Kpxmwh.aspx"); GridViewBind(); }
protected void Page_Load(object sender, EventArgs e) { hkdb.VeriSess("3"); if (!IsPostBack) { hkdb.PassTo("60308", "60308"); SqlDataReader datar = SqlHelper.ExecuteReader("SELECT * FROM QY WHERE QY_ID='001'"); if (datar.Read()) { qybm.Text = datar["qy_id"].ToString(); qc.Text = datar["qy_qc"].ToString(); jc.Text = datar["qy_jc"].ToString(); lx.Text = datar["qy_lx"].ToString(); dz.Text = datar["qy_dz"].ToString(); yzbm.Text = datar["qy_yzbm"].ToString(); dh.Text = datar["qy_dh"].ToString(); cz.Text = datar["qy_cz"].ToString(); wz.Text = datar["qy_wz"].ToString(); mail.Text = datar["qy_mail"].ToString(); //gsh.Text = datar["qy_gsh"].ToString(); //dsh.Text = datar["qy_dsh"].ToString(); //khyh.Text = datar["qy_khyh"].ToString(); //yhzh.Text = datar["qy_yhzh"].ToString(); pp.Text = datar["qy_pp"].ToString(); ywmc.Text = datar["qy_ywmc"].ToString(); //frdb.Text = datar["qy_frdb"].ToString(); //zcsj.Text = hkdb.GetDate(datar["qy_zcsj"].ToString()); sshy.Text = datar["qy_sshy"].ToString(); //zczj.Text = datar["qy_zczj"].ToString(); ygrs.Text = datar["qy_ygrs"].ToString(); qyjj.Text = datar["qy_qyjj"].ToString(); qy_fjylurl.Text = datar["qy_fjylurl"].ToString(); datar.Close(); } else { datar.Close(); mydb.Alert_Close("未检索到企业档案信息!"); } //判断PMS、EAM string sql = "SELECT Xh FROM hk_INIT WHERE ProduID='F' OR ProduID='E'"; if (bd.CheckRepeat(sql) == "true") { if (this.Session["systype"].ToString() == "F" | this.Session["systype"].ToString() == "E" | this.Session["systype"].ToString() == "A") { AddBtn.Visible = true; GridView1.Visible = true; //页面绑定 GridViewBind(); } } } }
protected void Save_Click(object sender, EventArgs e) { //Demo if (hkdb.IsDemo("Y") == "true") { return; } //Portal string ynbmglzStr = hkdb.GetValueChk_Str(ynbmglz.Checked); //姓名判断(重复) if (bd.CheckRepeat("SELECT UI_ID FROM YH WHERE UI_DESC='" + hkdb.GetStr(xm.Text) + "' AND UI_LX='企业' AND UI_ID<>'" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'") == "true") { mydb.Alert("保存失败,该用户姓名已存在!"); return; } //姓名判断(与编码重复) if (bd.CheckRepeat("SELECT UI_ID FROM YH WHERE UI_ID='" + hkdb.GetStr(xm.Text) + "' AND UI_LX='企业' AND UI_ID<>'" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'") == "true") { mydb.Alert("保存失败,该用户姓名与已有的用户编码相同!"); return; } SqlHelper.ExecuteSql("UPDATE YH SET ui_desc='" + hkdb.GetStr(xm.Text) + "',ui_sex='" + xb.SelectedValue + "',ui_role='" + gwjs.SelectedValue + "',ui_status='" + zt.SelectedValue + "',ui_comm='" + hkdb.GetStr(bz.Text) + "',ui_zw='" + zwmc.SelectedValue + "',ui_bgdh='" + hkdb.GetStr(bgdh.Text) + "',ui_czdh='" + hkdb.GetStr(czdh.Text) + "',ui_yddh='" + hkdb.GetStr(yddh.Text) + "',ui_mail='" + hkdb.GetStr(mail.Text) + "',ui_sdate='" + hkdb.GetStr(txtSdate.Text) + "',ui_edate='" + hkdb.GetStr(txtEdate.Text) + "',ui_csrq='" + hkdb.GetStr(csrq.Text) + "',ui_ssbm='" + bm.SelectedValue + "',yn_bmglz='" + ynbmglzStr + "',ui_ssgs='" + ssgs.SelectedValue + "',photo='" + hkdb.GetStr(fj.Text) + "' WHERE UI_ID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); //日志 mydb.InsertLog("修改用户【" + hkdb.GetStr(xm.Text) + "】", "60305"); mydb.Alert_Refresh_Close("用户保存成功!", "yh.aspx"); }
protected void Save_Click(object sender, EventArgs e) { if (lbltitle.Text == "新增") { //名称判断(包含) if (bd.CheckRepeat("SELECT ROLE_NAME FROM JS WHERE CHARINDEX('" + hkdb.GetStr(jsmc.Text) + "',role_name)>0") == "true") { mydb.Alert("保存失败,该角色名称与系统中已有的角色名称存在包含关系!请重新输入"); return; } int newID = (Int32)SqlHelper.ExecuteScalar("INSERT INTO JS(ROLE_NAME,ROLE_LX,ROLE_COMM,CJR,CJSJ) VALUES('" + hkdb.GetStr(jsmc.Text) + "','企业','" + hkdb.GetStr(bz.Text) + "','" + this.Session["userid"] + "',GETDATE())" + "SELECT CAST(scope_identity() AS int)"); //日志 mydb.InsertLog("新增角色【" + hkdb.GetStr(jsmc.Text) + "】", "60302"); } else { //名称判断(包含) if (bd.CheckRepeat("SELECT ROLE_NAME FROM JS WHERE CHARINDEX('" + hkdb.GetStr(jsmc.Text) + "',role_name)>0 AND ROLE_ID<>'" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'") == "true") { mydb.Alert("保存失败,该角色名称与系统中已有的角色名称存在包含关系!请重新输入"); return; } SqlHelper.ExecuteSql("UPDATE JS SET ROLE_NAME='" + hkdb.GetStr(jsmc.Text) + "',ROLE_COMM='" + hkdb.GetStr(bz.Text) + "' WHERE ROLE_ID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); //日志 mydb.InsertLog("修改角色【" + hkdb.GetStr(jsmc.Text) + "】", "60302"); } //判断btn Button btn = (Button)sender; string s = btn.ID; if (s == "SaveAddBtn") { Clear_Click(); mydb.Alert_Refresh("保存成功,请新增下一条记录!", "Role.aspx"); } else { mydb.Alert_Refresh_Close("保存成功!", "Role.aspx"); } }
protected void Del_Click(object sender, EventArgs e) { string sql1 = "SELECT * FROM BM WHERE bm_sjbm = '" + hkdb.GetStr(Request.QueryString["id"]) + "'"; if (bd.CheckRepeat(sql1) == "true") { mydb.Alert("删除失败,当前部门存在下级部门!"); return; } string sql2 = "SELECT * FROM yh WHERE ui_ssbm = '" + hkdb.GetStr(Request.QueryString["id"]) + "'"; if (bd.CheckRepeat(sql2) == "true") { mydb.Alert("删除失败,当前部门下存在用户!"); return; } string sql_report = "SELECT * FROM hk_Init WHERE ProduID='R'"; if (bd.CheckRepeat(sql_report) == "true") { SqlHelper.ExecuteSql("DELETE FROM BM_Report WHERE ssbmid='" + hkdb.GetStr(Request.QueryString["id"]) + "'"); } string sql_scm = "SELECT * FROM hk_Init WHERE ProduID='G'"; if (bd.CheckRepeat(sql_scm) == "true") { SqlHelper.ExecuteSql("DELETE FROM BM_SCM WHERE ssbmid='" + hkdb.GetStr(Request.QueryString["id"]) + "'"); } string sql_kms = "SELECT * FROM hk_Init WHERE ProduID='K'"; if (bd.CheckRepeat(sql_kms) == "true") { SqlHelper.ExecuteSql("DELETE FROM BM_KMS WHERE ssbmid='" + hkdb.GetStr(Request.QueryString["id"]) + "'"); } SqlHelper.ExecuteSql("DELETE FROM BM WHERE bm_id='" + hkdb.GetStr(Request.QueryString["id"]) + "'"); mydb.Alert_Parent("删除成功!", "Dept.aspx"); }
public void Save_Click(object Sender, EventArgs E) { if (lbltitle.Text == "新增") { //编码判断(重复) if (bd.CheckRepeat("SELECT pid FROM HR_Kpdf_Pw WHERE pid='" + hkdb.GetStr(pid.Text) + "'") == "true") { mydb.Alert("保存失败,此编码已经存在!"); return; } SqlHelper.ExecuteScalar("INSERT INTO HR_Kpdf_Pw(pid,pwxm,pwlx,pwbz,cxmy,cjr,cjsj) VALUES" + "('" + hkdb.GetStr(pid.Text) + "','" + hkdb.GetStr(pwxm.Text) + "','" + pwlx.SelectedValue + "','" + hkdb.GetStr(bz.Text) + "','E10ADC3949BA59ABBE56E057F20F883E','" + this.Session["userid"] + "',GETDATE())"); //判断btn Button btn = (Button)Sender; string s = btn.ID; if (s == "SaveAddBtn") { Clear_Click(); mydb.Alert_Refresh("保存成功,请新增下一条记录!", "Pwwh.aspx"); } else { mydb.Alert_Refresh("保存成功!", "Pwwh.aspx"); } } else { //判断该评委名下是否存在未结束的考评项目 string sql1 = "SELECT KPID FROM HR_Kpdf_Kpxm01 WHERE CHARINDEX('" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "',CypwIDs)>0 AND KPZT<>'已结束'"; if (bd.CheckRepeat(sql1) == "true") { mydb.Alert("保存失败,该评委参与的考评项目中,存在未结束的记录!"); return; } SqlHelper.ExecuteSql("UPDATE HR_Kpdf_Pw SET pwlx='" + pwlx.SelectedValue + "',pwbz='" + hkdb.GetStr(bz.Text) + "',xgr='" + this.Session["userid"] + "',xgsj=GETDATE() WHERE pid='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); mydb.Alert_Refresh("保存成功!", "Pwwh.aspx"); } }
protected void Save_Click(object sender, EventArgs e) { if (lbltitle.Text == "新增") { //判断重复 string sql = "SELECT smid FROM OA_KQ_SPSM WHERE SMLX='" + smlx.SelectedValue + "' AND SYRY='" + syry.SelectedValue + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("此【类型+适用人员】下已存在记录,不能重复!"); return; } SqlHelper.ExecuteSql("insert into OA_KQ_SPSM(smmc,smlx,syry,smnr,cjr,cjsj) values('" + hkdb.GetStr(smmc.Text) + "','" + smlx.SelectedValue + "','" + syry.SelectedValue + "','" + editor.Value + "','" + this.Session["userid"] + "',GETDATE())"); } else { //判断重复 string sql = "SELECT smid FROM OA_KQ_SPSM WHERE SMLX='" + smlx.SelectedValue + "' AND SYRY='" + syry.SelectedValue + "' AND SMID<>'" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("此【类型+适用人员】下已存在记录,不能重复!"); return; } SqlHelper.ExecuteSql("update OA_KQ_SPSM set smmc='" + hkdb.GetStr(smmc.Text) + "',smlx='" + smlx.SelectedValue + "',syry='" + syry.SelectedValue + "',smnr='" + editor.Value + "' where smid='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); } Button btn = (Button)sender; string s = btn.ID; if (s == "SaveAddBtn") { Clear_Click(); mydb.Alert_Refresh("保存成功,请新增下一条记录!", "Kqspsm.aspx"); } else { mydb.Alert_Refresh_Close("保存成功!", "Kqspsm.aspx"); } }
protected void Save_Click(object sender, EventArgs e) { //编码判断(重复) if (bd.CheckRepeat("SELECT id FROM OA_Rwfbdw WHERE num='" + hkdb.GetStr(num.Text) + "'") == "true") { mydb.Alert("保存失败,该序号已存在!"); return; } //名称判断(重复) if (bd.CheckRepeat("SELECT id FROM OA_Rwfbdw WHERE name='" + hkdb.GetStr(name.Text) + "'") == "true") { mydb.Alert("保存失败,该单位已存在!"); return; } //SqlHelper.ExecuteSql("INSERT INTO hk_MySet(FK_uid,ynRemind,RemindTime,RemindMode,RemindSound,Mail_Qc,Mail_Smtp,Mail_Dlyh,Mail_Dlmm,Mail_Port,Mail_Fsr,PageCount) VALUES('" + hkdb.GetStr(yhbm.Text) + "','是','60000','否','1.swf','*****@*****.**','smtp.sohu.com','ok8209','haokee3000','25','系统管理员',15)"); SqlHelper.ExecuteSql("INSERT INTO OA_Rwfbdw (num,name,address,tel,charge) VALUES('" + hkdb.GetStr(num.Text) + "','" + hkdb.GetStr(name.Text) + "','" + hkdb.GetStr(address.Text) + "','" + hkdb.GetStr(tel.Text) + "','" + hkdb.GetStr(charge.Text) + "')"); //日志 mydb.InsertLog("新增任务发布单位【" + name.Text + "】", "13802"); //判断btn Button btn = (Button)sender; string s = btn.ID; if (s == "SaveAddBtn") { Clear_Click(); mydb.Alert_Refresh("保存成功,请新增下一条记录!", "rwfabudanwei.aspx"); } else { mydb.Alert_Refresh_Close("保存成功!", "rwfabudanwei.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { hkdb.VeriSess("3"); if (!IsPostBack) { hkdb.PassTo("10103", "0"); if (this.Session["systype"].ToString() == "A") //主登录页 { SqlDataReader dr_pms = SqlHelper.ExecuteReader("SELECT xh FROM hk_Init WHERE produID='F'"); if (dr_pms.Read()) { p_dxlx_pms.Visible = true; } dr_pms.Close(); SqlDataReader dr_kms = SqlHelper.ExecuteReader("SELECT xh FROM hk_Init WHERE produID='K'"); if (dr_kms.Read()) { p_dxlx_kms.Visible = true; } dr_kms.Close(); } else //子登录页 { if (this.Session["systype"].ToString() == "F") { p_dxlx_pms.Visible = true; } if (this.Session["systype"].ToString() == "K") { p_dxlx_kms.Visible = true; } } if (bd.CheckRepeat("SELECT Xh FROM hk_Init WHERE ProduID='F' AND ChildVersion='0'") == "true") { imgBtn_zh.OnClientClick = "javascript:openAddressList('../../choose/pms/yddhview_zh.aspx');"; imgBtn_yz.OnClientClick = "javascript:openAddressList('../../choose/pms/yddhview_yz.aspx');"; } else { imgBtn_zh.OnClientClick = "javascript:openAddressList('../../choose/pms2/yddhview_zh.aspx');"; imgBtn_yz.OnClientClick = "javascript:openAddressList('../../choose/pms2/yddhview_yz.aspx');"; } ds.Visible = false; } }
//操作权限 protected void Save_Click(object sender, EventArgs e) { //编码判断(重复) if (bd.CheckRepeat("SELECT id FROM OA_Rwfbdw WHERE num='" + hkdb.GetStr(num.Text) + "' and id!='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'") == "true") { mydb.Alert("保存失败,该序号已存在!"); return; } //名称判断(重复) if (bd.CheckRepeat("SELECT id FROM OA_Rwfbdw WHERE name='" + hkdb.GetStr(name.Text) + "' and id!='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'") == "true") { mydb.Alert("保存失败,该单位已存在!"); return; } SqlHelper.ExecuteSql("Update OA_Rwfbdw set num='" + hkdb.GetStr(num.Text) + "',name='" + hkdb.GetStr(name.Text) + "',address='" + hkdb.GetStr(address.Text) + "',tel='" + hkdb.GetStr(tel.Text) + "',charge='" + hkdb.GetStr(charge.Text) + "' WHERE id='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); //日志 mydb.InsertLog("修改任务发布单位【" + hkdb.GetStr(name.Text) + "】", "13802"); mydb.Alert_Refresh_Close("保存成功!", "rwfabudanwei.aspx"); }
//删除 protected void Del_Click(object sender, EventArgs e) { string sql = "SELECT ID FROM OA_FilesManageBookLog WHERE BookId='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("删除失败,此文件下已存在借阅记录!"); return; } SqlHelper.ExecuteSql("DELETE FROM OA_FilesManageBook WHERE ID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); mydb.Alert_Refresh_Close("删除成功!", "FilesManageBook.aspx"); }
public void Page_Load(object Sender, EventArgs E) { hkdb.VeriSess("4"); if (!IsPostBack) { hkdb.PassTo("81106", "0"); //附件 attKey = this.Session["fjlx"].ToString(); BindAttr(); Random g = new Random(); string rad = g.Next(10000).ToString(); Number.Text = "" + System.DateTime.Now.Year.ToString() + "" + System.DateTime.Now.Month.ToString() + "" + System.DateTime.Now.Day.ToString() + "" + System.DateTime.Now.Hour.ToString() + "" + System.DateTime.Now.Minute.ToString() + "" + System.DateTime.Now.Second.ToString() + "" + System.DateTime.Now.Millisecond.ToString() + "" + rad + ""; if (!string.IsNullOrEmpty(Request.QueryString["kpid"])) { lblname.Text = SqlHelper.ExecuteScalar("SELECT UI_DESC FROM YH WHERE UI_ID='" + hkdb.GetStr(Request.QueryString["bid"].ToString()) + "'").ToString(); //判断重复 string sql = "SELECT kpzt FROM HR_Kpdf_Kpxm01 WHERE kpid='" + hkdb.GetStr(Request.QueryString["kpid"].ToString()) + "' and kpzt='未生效'"; if (bd.CheckRepeat(sql) == "true") { uploadBtn.Visible = true; AttDelBtn.Visible = true; SaveBtn.Visible = true; } SqlDataReader dr = SqlHelper.ExecuteReader("SELECT A.* FROM HR_Kpdf_Kpxm03 A WHERE sskpid='" + hkdb.GetStr(Request.QueryString["kpid"].ToString()) + "' AND ssbid='" + hkdb.GetStr(Request.QueryString["bid"].ToString()) + "'"); if (dr.Read()) { lbltitle.Text = "修改"; if (!string.IsNullOrEmpty(dr["kpfj"].ToString())) { Number.Text = dr["kpfj"].ToString(); } } else { lbltitle.Text = "新增"; } dr.Close(); } } BindDpList(); }
protected void page_load(object sender, EventArgs e) { hkdb.VeriSess("3"); sdate = string.Format("{0:yyyy}", DateTime.Now) + "-01-01"; edate = string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now); strColor = "AFD8F8,F6BD0F,8BBA00,FF8E46,008E8E,D64646,8E468E,588526,B3AA00,008ED6,9D080D,A186BE"; if (!IsPostBack) { hkdb.PassTo("10123", "10123"); //物业 if (bd.CheckRepeat("SELECT Xh FROM hk_Init WHERE ProduID='F' AND ChildVersion='0'") == "true") { lblpms.Text = "0"; } else { lblpms.Text = "1"; } //资产 if (bd.CheckRepeat("SELECT Xh FROM hk_Init WHERE ProduID='E' AND ChildVersion='0'") == "true") { lbleam.Text = "0"; } else { lbleam.Text = "1"; } GridViewBind(); } }
protected void Page_Load(object sender, EventArgs e) { hkdb.VeriSess("3"); if (!IsPostBack) { string sql = "SELECT * FROM HK_QUICK WHERE CJR='" + this.Session["userid"] + "' AND QJQM<>'" + Dns.GetHostName() + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("提醒:下列快捷方式中有部分可能不是在这台电脑上创建的!!!如出现不能正常使用的快捷方式,请参照屏幕下方的步骤提示按顺序执行即可。"); //return; } } GridViewBind(); }
//删除 protected void Del_Click(object sender, EventArgs e) { string sql = "SELECT * FROM YH WHERE UI_ZW='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("删除失败,此职位下已有用户信息!"); return; } SqlHelper.ExecuteSql("DELETE FROM ZW WHERE ZWID ='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); //日志 mydb.InsertLog("删除职位【" + hkdb.GetStr(zwmc.Text) + "】", "60303"); mydb.Alert_Refresh_Close("删除成功!", "zwwh.aspx"); }
//保存 protected void Save_Click(object sender, EventArgs e) { if (ynqd1.Checked == false && ynqt1.Checked == false && ynqd2.Checked == false && ynqt2.Checked == false && ynqd3.Checked == false && ynqt3.Checked == false) { mydb.Alert("签到类型必须至少选择一项!"); return; } //同一日期只能存在一条记录,不能重复 string sql = "SELECT sid FROM OA_KQ_SM01 WHERE Sqrid = '" + this.Session["UserID"] + "' AND qdsj='" + hkdb.GetStr(qdsj.Text) + "' AND SID<>'" + hkdb.GetStr(Request.QueryString["id"]) + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("您在该日期下已提交过考勤说明记录,不能重复!\\n请在原考勤说明记录上直接修改并保存后,重新送审即可!"); return; } SqlHelper.ExecuteSql("UPDATE OA_KQ_SM01 SET QDSJ='" + hkdb.GetStr(qdsj.Text) + "',YNQD1='" + hkdb.GetValueChk_Str(ynqd1.Checked) + "',YNQT1='" + hkdb.GetValueChk_Str(ynqt1.Checked) + "',YNQD2='" + hkdb.GetValueChk_Str(ynqd2.Checked) + "',YNQT2='" + hkdb.GetValueChk_Str(ynqt2.Checked) + "',YNQD3='" + hkdb.GetValueChk_Str(ynqd3.Checked) + "',YNQT3='" + hkdb.GetValueChk_Str(ynqt3.Checked) + "',KQQKSM='" + hkdb.GetStr(kqqksm.Text) + "',jsrIDs='" + jsr.SelectedValue + "',jsrNames='" + jsr.SelectedItem.Text + "',smfj='" + hkdb.GetStr(Number.Text) + "' WHERE SID='" + hkdb.GetStr(Request.QueryString["id"]) + "'"); mydb.Alert_Refresh("保存成功!", "Kqsmlr.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { HttpCookie login_cookies = Request.Cookies["info_login"]; if (login_cookies != null) { UserName.Text = login_cookies["UserName"]; //UserPass.Text= login_cookies["UserPass"]; //TextMode="Password"不会赋值 UserPass.Attributes.Add("value", login_cookies["UserPass"]); chk_remember.Checked = true; } //测试 string sql = "SELECT paramt FROM hk_CSDA WHERE paramt='P_sdate' AND p_string='0'"; if (bd.CheckRepeat(sql) == "true") { lblCs.Text = "试用帐号:oa 密码:1<br>"; lblCs.Visible = true; } } }
//删除 protected void Del_Click(object sender, EventArgs e) { //Demo if (hkdb.IsDemo("Y") == "true") { return; } string sql = "SELECT * FROM hk_WDYJ WHERE YJX='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("删除失败,该意见箱下已有意见信息!"); return; } SqlHelper.ExecuteSql("DELETE FROM hk_YJX WHERE id = '" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); //日志 mydb.InsertLog("删除意见箱【" + mc.Text + "】", "11305"); mydb.Alert_Refresh_Close("删除成功!", "Yjxsz.aspx"); }
protected void Save_Click(object sender, EventArgs e) { string strindi = "0"; string strdept = "0"; string strcorp = "0"; string strfull = "0"; string stradd = "0"; string strmod = "0"; string strdel = "0"; string strexp = "0"; string straud = "0"; string strexe = "0"; string strque = "0"; if (cbindi.Checked == true) { strindi = moduid.Text + "1"; } if (cbdept.Checked == true) { strdept = moduid.Text + "2"; } if (cbcorp.Checked == true) { strcorp = moduid.Text + "9"; } if (cbfull.Checked == true) { strfull = moduid.Text + "f"; } if (cbadd.Checked == true) { stradd = moduid.Text + "a"; } if (cbmod.Checked == true) { strmod = moduid.Text + "m"; } if (cbdel.Checked == true) { strdel = moduid.Text + "d"; } if (cbexp.Checked == true) { strexp = moduid.Text + "e"; } if (cbaud.Checked == true) { straud = moduid.Text + "u"; } if (cbexe.Checked == true) { strexe = moduid.Text + "x"; } if (cbque.Checked == true) { strque = moduid.Text + "q"; } //判断btn Button btn = (Button)sender; string s = btn.ID; if (s == "AddBtn") { moduid.Enabled = true; moduid.CssClass = "mytext"; moduid.Text = ""; modumc.Text = ""; moduwjlj.Text = ""; modu_icon.Text = ""; modubz.Text = ""; moduupid.SelectedValue = "0"; rbzt.SelectedValue = "启用"; modu_lx.SelectedValue = ""; modu_xz.SelectedValue = "标准模块"; yn_oper.SelectedValue = "否"; cbindi.Checked = false; cbdept.Checked = false; cbcorp.Checked = false; cbfull.Checked = false; cbadd.Checked = false; cbmod.Checked = false; cbdel.Checked = false; cbexp.Checked = false; cbaud.Checked = false; cbexe.Checked = false; cbque.Checked = false; yn_oper.Enabled = true; cbindi.Enabled = true; cbdept.Enabled = true; cbcorp.Enabled = true; p_oper.Visible = false; labelstatus.Text = "新增"; SaveBtn.Enabled = true; DelBtn.Enabled = false; } else { if (labelstatus.Text == "修改") { //Demo if (hkdb.IsDemo("Y") == "true") { return; } SqlHelper.ExecuteSql("UPDATE HK_MODU SET MODU_ZT='" + rbzt.SelectedValue + "',modu_mc='" + hkdb.GetStr(modumc.Text) + "',modu_wjlj='" + hkdb.GetStr(moduwjlj.Text) + "',modu_icon='" + hkdb.GetStr(modu_icon.Text) + "',modu_bz='" + hkdb.GetStr(modubz.Text) + "',modu_upid='" + moduupid.SelectedValue + "',modu_lx='" + modu_lx.SelectedValue + "',modu_xz='" + modu_xz.SelectedValue + "',yn_oper='" + yn_oper.SelectedValue + "',o_full='" + strfull + "',o_add='" + stradd + "',o_mod='" + strmod + "',o_del='" + strdel + "',o_exp='" + strexp + "',o_aud='" + straud + "',o_exe='" + strexe + "',o_que='" + strque + "',d_indi='" + strindi + "',d_dept='" + strdept + "',d_corp='" + strcorp + "' WHERE MODU_ID='" + hkdb.GetStr(Request.QueryString["classid"].ToString()) + "'"); mydb.Alert("保存成功!"); Response.Write("<script language=javascript>"); Response.Write("window.parent.lframe60101.location='Mk_l.aspx';<"); Response.Write("/script>"); } else { string sql = "SELECT * FROM HK_MODU WHERE MODU_ID='" + hkdb.GetStr(moduid.Text) + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("保存失败,此编码已经存在!"); return; } SqlHelper.ExecuteSql("INSERT INTO HK_MODU(MODU_ID,MODU_MC,MODU_UPID,MODU_WJLJ,MODU_ZT,MODU_BZ,MODU_LX,CJR,CJSJ,MODU_ICON,ORDERID,MODU_XZ,YN_OPER,O_FULL,O_ADD,O_MOD,O_DEL,O_EXP,O_AUD,O_EXE,O_QUE,D_INDI,D_DEPT,D_CORP) VALUES('" + hkdb.GetStr(moduid.Text) + "','" + hkdb.GetStr(modumc.Text) + "','" + moduupid.SelectedValue + "','" + hkdb.GetStr(moduwjlj.Text) + "','" + rbzt.SelectedValue + "','" + hkdb.GetStr(modubz.Text) + "','" + modu_lx.SelectedValue + "','" + this.Session["userid"] + "',GETDATE(),'" + hkdb.GetStr(modu_icon.Text) + "','" + hkdb.GetStr(moduid.Text) + "','" + modu_xz.SelectedValue + "','" + yn_oper.SelectedValue + "','" + strfull + "','" + stradd + "','" + strmod + "','" + strdel + "','" + strexp + "','" + straud + "','" + strexe + "','" + strque + "','" + strindi + "','" + strdept + "','" + strcorp + "')"); mydb.Alert("保存成功!"); moduid.Text = ""; modumc.Text = ""; moduwjlj.Text = ""; modu_icon.Text = ""; modubz.Text = ""; rbzt.SelectedValue = "启用"; modu_lx.SelectedValue = ""; modu_xz.SelectedValue = "标准模块"; yn_oper.SelectedValue = "否"; cbindi.Checked = false; cbdept.Checked = false; cbcorp.Checked = false; cbfull.Checked = false; cbadd.Checked = false; cbmod.Checked = false; cbdel.Checked = false; cbexp.Checked = false; cbaud.Checked = false; cbexe.Checked = false; cbque.Checked = false; p_oper.Visible = false; Response.Write("<script language=javascript>"); Response.Write("window.parent.lframe60101.location='Mk_l.aspx';"); Response.Write("window.parent.rframe60101.location='mk_r.aspx?k=nex';<"); Response.Write("/script>"); } } }
protected void Save_Click(object sender, EventArgs e) { //编码判断(重复) string sql = "SELECT BM_ID FROM BM WHERE BM_BM = '" + hkdb.GetStr(bm_bm.Text) + "'"; if (bd.CheckRepeat(sql) == "true") { mydb.Alert("保存失败,该部门编码已存在,不能重复!"); return; } //名称判断(包含) //if (bd.CheckRepeat("SELECT BM_MC FROM BM WHERE CHARINDEX('" + hkdb.GetStr(bm_mc.Text) + "',bm_mc)>0") == "true") //{ // mydb.Alert("保存失败,该部门名称与系统中已有的部门名称存在包含关系!请重新输入"); // return; //} SqlDataReader datar = SqlHelper.ExecuteReader("SELECT TOP 1 * FROM BM WHERE BM_ID='" + bm_sjbm.SelectedValue + "'"); if (datar.Read()) { strQxStr = datar["dQxStr"].ToString(); strLine = datar["dLine"].ToString(); } datar.Close(); if (bm_sjbm.SelectedValue == "0") { SqlDataReader datar2 = SqlHelper.ExecuteReader("SELECT TOP 1 * FROM BM WHERE BM_SJBM='0' ORDER BY DQXSTR DESC"); if (datar2.Read()) { SqlDataReader datar3 = SqlHelper.ExecuteReader("SELECT TOP 1 * FROM hk_DeptKey WHERE dkID>(SELECT dkID FROM hk_DeptKey WHERE dkName='" + datar2["dQxStr"] + "') ORDER BY dkName ASC"); if (datar3.Read()) { strQx = datar3["dkName"].ToString(); strL = "|-"; } else { strQx = "aaaaa"; strL = "|-"; } datar3.Close(); } else { strQx = "aaaaa"; strL = "|-"; } datar2.Close(); } else { SqlDataReader datar2 = SqlHelper.ExecuteReader("SELECT * FROM BM WHERE BM_ID='" + bm_sjbm.SelectedValue + "'"); if (datar2.Read()) { if (datar2["dQxStr"].ToString().Length == 5) { SqlDataReader datar3 = SqlHelper.ExecuteReader("SELECT TOP 1 * FROM BM WHERE dQxStr LIKE '%" + datar2["dQxStr"].ToString() + "%' AND LEN(dQxStr)=9 ORDER BY dQxStr DESC"); if (datar3.Read()) { string iqx = null; iqx = datar3["dQxStr"].ToString().Substring(datar3["dQxStr"].ToString().Length - 4, 3); int iqx_s = int.Parse(iqx) + 1; strQx = "" + strQxStr + "" + iqx_s + "a"; strL = "|---"; } else { strQx = "" + strQxStr + "100a"; strL = "|---"; } datar3.Close(); } else { SqlDataReader datar3 = SqlHelper.ExecuteReader("SELECT TOP 1 * FROM BM WHERE dQxStr LIKE '%" + datar2["dQxStr"].ToString() + "%' AND LEN(dQxStr)=" + datar2["dQxStr"].ToString().Length + "+4 ORDER BY dQxStr DESC"); if (datar3.Read()) { string iqx = null; iqx = datar3["dQxStr"].ToString().Substring(datar3["dQxStr"].ToString().Length - 4, 3); int iqx_s = int.Parse(iqx) + 1; strQx = "" + strQxStr + "" + iqx_s + "a"; strL = "|-"; for (int i = 0; i < strLine.ToString().Length + 2; i++) { strL = strL + "-"; } } else { SqlDataReader datar4 = SqlHelper.ExecuteReader("SELECT TOP 1 * FROM BM WHERE dQxStr LIKE '%" + datar2["dQxStr"].ToString().Substring(0, datar2["dQxStr"].ToString().Length - 4) + "%' AND LEN(dQxStr)=" + datar2["dQxStr"].ToString().Length + " ORDER BY dQxStr DESC"); if (datar4.Read()) { strQx = "" + strQxStr + "100a"; strL = "|-"; for (int i = 0; i < strLine.ToString().Length + 2; i++) { strL = strL + "-"; } } datar4.Close(); } datar3.Close(); } } datar2.Close(); } int iBmid = Convert.ToInt32(SqlHelper.ExecuteScalar("INSERT INTO BM(BM_BM,BM_MC,BM_LX,BM_FZR,BM_DH,BM_CZ,BM_BZ,BM_SJBM,DLINE,DQXSTR,CJR,CJSJ,JGLB,BMGLQX) VALUES('" + hkdb.GetStr(bm_bm.Text) + "','" + hkdb.GetStr(bm_mc.Text) + "','" + bm_lx.SelectedValue + "','" + hkdb.GetStr(bm_fzr.Text) + "','" + hkdb.GetStr(bm_dh.Text) + "','" + hkdb.GetStr(bm_cz.Text) + "','" + hkdb.GetStr(bm_bz.Text) + "','" + bm_sjbm.SelectedValue + "','" + strL + "','" + strQx + "','" + this.Session["userid"] + "',Getdate(),'0','" + bmglqx.SelectedValue + "')" + "SELECT CAST(scope_identity() AS int)")); string sql_report = "SELECT * FROM hk_Init WHERE ProduID='R'"; if (bd.CheckRepeat(sql_report) == "true") { SqlHelper.ExecuteSql("INSERT INTO BM_Report(SSBMID,YNSLBM) VALUES('" + iBmid + "','否')"); } string sql_scm = "SELECT * FROM hk_Init WHERE ProduID='G'"; if (bd.CheckRepeat(sql_scm) == "true") { SqlHelper.ExecuteSql("INSERT INTO BM_SCM(SSBMID,BM_CYZS) VALUES('" + iBmid + "','否')"); } string sql_kms = "SELECT * FROM hk_Init WHERE ProduID='K'"; if (bd.CheckRepeat(sql_kms) == "true") { SqlHelper.ExecuteSql("INSERT INTO BM_KMS(SSBMID) VALUES('" + iBmid + "')"); } //判断btn Button btn = (Button)sender; string s = btn.ID; if (s == "SaveAddBtn") { bm_sjbm.Items.Clear(); bm_lx.Items.Clear(); DropDownListBind(); Clear_Click(); mydb.Alert("保存成功,请新增下一条记录!"); } else { mydb.Alert_Parent("保存成功!", "Dept.aspx"); } }
protected void Save_Click(object Sender, EventArgs E) { //判断必须有、且只能有1名 总经理评委 int iPw_zr = Convert.ToInt32(SqlHelper.ExecuteScalar("SELECT COUNT(*) FROM HR_Kpdf_Pw WHERE CHARINDEX(pid,'" + hkdb.GetStr(UserID.Text) + "')>0 AND PWLX='总经理评委'").ToString()); if (iPw_zr != 1) { mydb.Alert("保存失败,参与评委中必须有、且只能有1名【总经理评委】!"); return; } //判断必须有、且只能有1名 工作人员评委 int iPw_gzry = Convert.ToInt32(SqlHelper.ExecuteScalar("SELECT COUNT(*) FROM HR_Kpdf_Pw WHERE CHARINDEX(pid,'" + hkdb.GetStr(UserID.Text) + "')>0 AND PWLX='工作人员评委'").ToString()); if (iPw_gzry != 1) { mydb.Alert("保存失败,参与评委中必须有、且只能有1名【工作人员评委】!"); return; } //判断必须有7名以上 一般评委 int iPw_ybpw = Convert.ToInt32(SqlHelper.ExecuteScalar("SELECT COUNT(*) FROM HR_Kpdf_Pw WHERE CHARINDEX(pid,'" + hkdb.GetStr(UserID.Text) + "')>0 AND PWLX='一般评委'").ToString()); if (iPw_ybpw < 7) { mydb.Alert("保存失败,参与评委中必须有7名以上【一般评委】!"); return; } //判断不能有考评管理员 SqlDataReader dr = SqlHelper.ExecuteReader("SELECT * FROM HR_Kpdf_Pw WHERE CHARINDEX(pid,'" + hkdb.GetStr(UserID.Text) + "')>0 AND PWLX='考评管理员'"); if (dr.Read()) { dr.Close(); mydb.Alert("参与评委中不能有【考评管理员】!"); return; } dr.Close(); if (lbltitle.Text == "新增") { //考评日期判断 int iDays = Convert.ToInt32(SqlHelper.ExecuteScalar("SELECT P_Value FROM HR_Kpdf_Paramt WHERE P_Code='WaitTime'").ToString()); if (bd.CheckRepeat("SELECT kpid FROM HR_Kpdf_Kpxm01 WHERE ('" + hkdb.GetStr(ksrq.Text) + "' BETWEEN ksrq AND jzrq+" + iDays + " OR '" + hkdb.GetStr(jzrq.Text) + "' BETWEEN ksrq AND jzrq+" + iDays + ")") == "true") { mydb.Alert("保存失败,该考评日期范围内不能重复创建考评项目!"); return; } kpid.Text = SqlHelper.ExecuteScalar("INSERT INTO HR_Kpdf_Kpxm01(kpqs,ksrq,jzrq,kpzt,CypwIDs,CypwNames,kpbz,cjr,cjsj,xmfj) VALUES" + "('" + hkdb.GetStr(kpqs.Text) + "','" + hkdb.GetStr(ksrq.Text) + "','" + hkdb.GetStr(jzrq.Text) + "','" + hkdb.GetStr(kpzt.Text) + "','" + hkdb.GetStr(UserID.Text) + "','" + hkdb.GetStr(UserName.Text) + "','" + hkdb.GetStr(bz.Text) + "','" + this.Session["userid"] + "',GETDATE(),'" + hkdb.GetStr(Number.Text) + "')" + "SELECT CAST(scope_identity() AS int)").ToString(); SaveBtn.Enabled = false; mydb.Alert_Refresh("保存成功!", "Kpxmwh.aspx"); } else { SqlHelper.ExecuteSql("UPDATE HR_Kpdf_Kpxm01 SET kpqs='" + hkdb.GetStr(kpqs.Text) + "',ksrq='" + hkdb.GetStr(ksrq.Text) + "',jzrq='" + hkdb.GetStr(jzrq.Text) + "',CypwIDs='" + hkdb.GetStr(UserID.Text) + "',CypwNames='" + hkdb.GetStr(UserName.Text) + "',kpbz='" + hkdb.GetStr(bz.Text) + "',xgr='" + this.Session["userid"] + "',xgsj=GETDATE(),xmfj='" + hkdb.GetStr(Number.Text) + "' WHERE KPID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); mydb.Alert_Refresh_Close("保存成功!", "Kpxmwh.aspx"); } }
protected void Save_Click(object sender, EventArgs e) { //Portal string ynbmglzStr = hkdb.GetValueChk_Str(ynbmglz.Checked); //编码判断(重复) if (bd.CheckRepeat("SELECT UI_ID FROM YH WHERE UI_ID='" + hkdb.GetStr(yhbm.Text) + "'") == "true") { mydb.Alert("保存失败,该用户编码已存在!"); return; } //编码判断(包含) //if (bd.CheckRepeat("SELECT UI_ID FROM YH WHERE CHARINDEX('" + hkdb.GetStr(yhbm.Text) + "',ui_id)>0") == "true") //{ // mydb.Alert("保存失败,该用户编码与系统中已有的编码存在包含关系!请重新输入"); // return; //} //姓名判断(重复) if (bd.CheckRepeat("SELECT UI_ID FROM YH WHERE UI_DESC='" + hkdb.GetStr(xm.Text) + "' AND UI_LX='企业'") == "true") { mydb.Alert("保存失败,该用户姓名已存在!"); return; } //姓名判断(与编码重复) //if (bd.CheckRepeat("SELECT UI_ID FROM YH WHERE UI_ID='" + hkdb.GetStr(xm.Text) + "' AND UI_LX='企业'") == "true") //{ // mydb.Alert("保存失败,该用户姓名与已有的用户编码相同!"); // return; //} //MD5加密 byte[] data = System.Text.Encoding.Unicode.GetBytes(dlmm.Text.ToCharArray()); System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] result = md5.ComputeHash(data); string sResult = System.Text.Encoding.Unicode.GetString(result); string EnPswdStr = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(dlmm.Text.ToString(), "MD5"); SqlHelper.ExecuteSql("INSERT INTO hk_MySet(FK_uid,ynRemind,RemindTime,RemindMode,RemindSound,Mail_Qc,Mail_Smtp,Mail_Dlyh,Mail_Dlmm,Mail_Port,Mail_Fsr,PageCount) VALUES('" + hkdb.GetStr(yhbm.Text) + "','是','60000','否','1.swf','*****@*****.**','smtp.sohu.com','ok8209','haokee3000','25','系统管理员',15)"); SqlHelper.ExecuteSql("INSERT INTO YH(UI_ID,UI_DESC,UI_SEX,UI_ROLE,UI_STATUS,UI_COMM,UI_PWD,UI_LX,UI_ZW,UI_BGDH,UI_YDDH,UI_CZDH,UI_MAIL,UI_SDATE,UI_EDATE,CJR,CJSJ,UI_CSRQ,UI_SSBM,YN_BMGLZ,UI_SSGS,photo,score,khscore) VALUES('" + hkdb.GetStr(yhbm.Text) + "','" + hkdb.GetStr(xm.Text) + "','" + xb.SelectedValue + "','" + gwjs.SelectedValue + "','" + zt.SelectedValue + "','" + hkdb.GetStr(bz.Text) + "','" + EnPswdStr + "','企业','" + zwmc.SelectedValue + "','" + hkdb.GetStr(bgdh.Text) + "','" + hkdb.GetStr(yddh.Text) + "','" + hkdb.GetStr(czdh.Text) + "','" + hkdb.GetStr(mail.Text) + "','" + hkdb.GetStr(txtSdate.Text) + "','" + hkdb.GetStr(txtEdate.Text) + "','" + this.Session["userid"] + "',GETDATE(),'" + hkdb.GetStr(csrq.Text) + "','" + bm.SelectedValue + "','" + ynbmglzStr + "','" + ssgs.SelectedValue + "','" + hkdb.GetStr(fj.Text) + "',0,100)"); string sql_kms = "SELECT * FROM hk_Init WHERE ProduID='K'"; if (bd.CheckRepeat(sql_kms) == "true") { SqlHelper.ExecuteSql("INSERT INTO YH_KMS(SSYHID,YN_CGSP,YN_CGRY) VALUES('" + hkdb.GetStr(yhbm.Text) + "','否','否')"); } string sql_report = "SELECT * FROM hk_Init WHERE ProduID='R'"; if (bd.CheckRepeat(sql_report) == "true") { SqlHelper.ExecuteSql("INSERT INTO YH_Report(SSYHID,YN_SL) VALUES('" + hkdb.GetStr(yhbm.Text) + "','否')"); } string sql_scm = "SELECT * FROM hk_Init WHERE ProduID='G'"; if (bd.CheckRepeat(sql_scm) == "true") { SqlHelper.ExecuteSql("INSERT INTO YH_SCM(SSYHID) VALUES('" + hkdb.GetStr(yhbm.Text) + "')"); } string sql_eam = "SELECT * FROM hk_Init WHERE ProduID='E'"; if (bd.CheckRepeat(sql_eam) == "true") { SqlHelper.ExecuteSql("INSERT INTO YH_EAM(SSYHID) VALUES('" + hkdb.GetStr(yhbm.Text) + "')"); } string sql_hr = "SELECT * FROM hk_Init WHERE ProduID='H'"; if (bd.CheckRepeat(sql_hr) == "true") { SqlHelper.ExecuteSql("INSERT INTO YH_HR(SSYHID) VALUES('" + hkdb.GetStr(yhbm.Text) + "')"); } //桌面 int k = 1; SqlDataReader datar = SqlHelper.ExecuteReader("SELECT * FROM hk_desktop WHERE ProduID='P'"); while (datar.Read()) { SqlHelper.ExecuteSql("INSERT INTO HK_MYDESK(SSDMID,ORDERID,USERNAME,TOPNUM) VALUES('" + datar["id"].ToString() + "'," + k + ",'" + hkdb.GetStr(yhbm.Text) + "','5')"); k = k + 1; } datar.Close(); //驾驶舱 int m = 1; SqlDataReader datarm = SqlHelper.ExecuteReader("SELECT * FROM hk_Dashboard WHERE ProduID='P'"); while (datarm.Read()) { SqlHelper.ExecuteSql("INSERT INTO HK_MYDASH(SSDBID,ORDERID,USERNAME,TOPNUM) VALUES('" + datarm["id"].ToString() + "'," + k + ",'" + hkdb.GetStr(yhbm.Text) + "','10')"); m = m + 1; } datarm.Close(); //日志 mydb.InsertLog("新增用户【" + xm.Text + "】", "60305"); //判断btn Button btn = (Button)sender; string s = btn.ID; if (s == "SaveAddBtn") { Clear_Click(); mydb.Alert_Refresh("保存成功,请新增下一条记录!", "yh.aspx"); } else { mydb.Alert_Refresh_Close("保存成功!", "yh.aspx"); } }
//保存 protected void Save_Click(object sender, EventArgs e) { //每次执行不能超过30天 DateTime sdate = Convert.ToDateTime(ksrq.Text); DateTime edate = Convert.ToDateTime(jsrq.Text); TimeSpan span = edate - sdate; if (int.Parse(String.Format("{0}", span.TotalDays)) > 100) { mydb.Alert("为避免给服务器带来过大压力,每次执行日期范围不能超过100天!"); return; } //判断当前参照人员是否有考勤信息 string sql = "SELECT * FROM OA_KQ_WorkDate WHERE YHID='" + hkdb.GetStr(UserID1.Text) + "' AND RQ BETWEEN '" + hkdb.GetStr(ksrq.Text) + "' AND '" + hkdb.GetStr(jsrq.Text) + "'"; if (bd.CheckRepeat(sql) == "false") { mydb.Alert("提交失败,当前参照人员在选定日期范围内未检索到工作日设置记录!"); return; } //1.获取当前选中的人员信息 string str = ""; if (yhfw.SelectedValue == "1") { string cal = ""; int i = 0; for (i = 0; i <= GridView1.Rows.Count - 1; i++) { CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[1].FindControl("del"); if (cb.Checked == true) { if (string.IsNullOrEmpty(cal)) { cal = GridView1.DataKeys[i].Value.ToString(); } else { cal = cal + "','" + GridView1.DataKeys[i].Value.ToString(); } } } if (!string.IsNullOrEmpty(cal)) { str = " WHERE UI_ID IN('" + cal + "')"; } else { mydb.Alert("请先选中记录再点击确定!"); return; } } //2.获取当前参照人员的考勤信息 SqlDataReader dr = SqlHelper.ExecuteReader("SELECT RQ,YNSB FROM OA_KQ_WorkDate WHERE YHID='" + hkdb.GetStr(UserID1.Text) + "' AND RQ BETWEEN '" + hkdb.GetStr(ksrq.Text) + "' AND '" + hkdb.GetStr(jsrq.Text) + "'"); while (dr.Read()) { SqlDataReader dr2 = SqlHelper.ExecuteReader("SELECT UI_ID FROM YH" + str); while (dr2.Read()) { SqlDataReader dr3 = SqlHelper.ExecuteReader("SELECT wdID FROM OA_KQ_WorkDate WHERE YHID='" + dr2["UI_ID"].ToString() + "' AND RQ='" + dr["RQ"].ToString() + "'"); if (dr3.Read()) { int id = Convert.ToInt32(dr3["wdID"].ToString()); dr3.Close(); //更新 //SqlHelper.ExecuteSql("UPDATE OA_KQ_WorkDate SET YNSB='" + dr["YNSB"].ToString() + "' WHERE YHID='" + dr2["UI_ID"].ToString() + "' AND RQ='" + dr["RQ"].ToString() + "'"); SqlHelper.ExecuteSql("UPDATE OA_KQ_WorkDate SET YNSB='" + dr["YNSB"].ToString() + "' WHERE wdID=" + id + ""); } else { dr3.Close(); //新增 SqlHelper.ExecuteSql("INSERT INTO OA_KQ_WorkDate(RQ,YNSB,YHID) VALUES('" + dr["RQ"].ToString() + "','" + dr["YNSB"].ToString() + "','" + dr2["UI_ID"].ToString() + "')"); } } dr2.Close(); } dr.Close(); GridViewBind(); mydb.Alert("批量更新成功!"); }