Beispiel #1
0
        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");
        }
Beispiel #2
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            string ynrzstr = hkdb.GetValueChk_Str(ynrz.Checked);

            SqlHelper.ExecuteSql("DELETE FROM DXZH");
            SqlHelper.ExecuteSql("INSERT INTO DXZH VALUES('" + hkdb.GetStr(yhm.Text) + "','" + hkdb.GetStr(ptmm.Text) + "','" + hkdb.GetStr(fwq.SelectedValue) + "','" + hkdb.GetStr(cscs.Text) + "','" + hkdb.GetStr(bjye.Text) + "','" + hkdb.GetStr(txsj.Text) + "','" + ynrzstr + "','" + hkdb.GetStr(dqye.Text) + "','" + this.Session["userid"] + "',GETDATE())");
            mydb.Alert("保存成功!");
        }
Beispiel #3
0
        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");
        }
Beispiel #4
0
        protected void Save_Click(object sender, EventArgs e)
        {
            //判断btn
            Button btn = (Button)sender;
            string s   = btn.ID;

            if (s == "AddBtn")
            {
                mlid.Text             = "";
                mlmc.Text             = "";
                DirList.SelectedValue = "0";
                share.Checked         = false;
                lblsta.Text           = "-> 新增状态";

                SaveBtn.Enabled = true;
                DelBtn.Enabled  = true;
            }
            else
            {
                string qstr = hkdb.GetValueChk_Str(share.Checked);

                if (lblsta.Text == "-> 修改状态")
                {
                    SqlHelper.ExecuteSql("UPDATE HK_NETDISK_DIR SET NAME='" + hkdb.GetStr(mlmc.Text) + "',ParentID=" + DirList.SelectedValue + ",Share='" + qstr + "' WHERE DirID='" + Request.QueryString["classid"].ToString() + "'");
                    mydb.Alert("保存成功!");
                    Response.Write("<script language=javascript>");
                    Response.Write("window.parent.lframe10109.location='folder_l.aspx';<");
                    Response.Write("/script>");
                }
                else
                {
                    //先插入记录
                    SqlHelper.ExecuteSql("INSERT INTO HK_NETDISK_DIR(NAME,PARENTID,USERID,CREATEDATE,SHARE) VALUES('" + hkdb.GetStr(mlmc.Text) + "','" + DirList.SelectedValue + "','" + this.Session["userid"] + "',GETDATE(),'" + qstr + "')");

                    mydb.Alert("保存成功!");
                    mlid.Text = "";
                    mlmc.Text = "";
                    //sjml.SelectedValue = ""
                    share.Checked = false;
                    Response.Write("<script language=javascript>");
                    Response.Write("window.parent.lframe10109.location='folder_l.aspx';");
                    Response.Write("window.parent.rframe10109.location='folder_r.aspx?k=nex';<");
                    Response.Write("/script>");
                }
            }
        }
Beispiel #5
0
        //发送邮件
        protected void Send_Click(object sender, EventArgs e)
        {
            //发件箱
            int iYjid = Convert.ToInt32(SqlHelper.ExecuteScalar("INSERT INTO hk_Mail_FS(jsrIDs,jsrNames,fsbt,fsnr,zyjb,yncg,scbz,msbz,yjfj,fslx,fsrID,fsrName,fssj) VALUES('" + hkdb.GetStr(UserID.Text) + "','" + hkdb.GetStr(UserName.Text) + "','" + hkdb.GetStr(bt.Text) + "','" + editor.Value + "','" + zyx.SelectedValue + "','否','否','" + hkdb.GetValueChk_Str(msbz.Checked) + "','" + hkdb.GetStr(Number.Text) + "','内部邮件','" + this.Session["UserID"] + "','" + this.Session["UserName"] + "',GETDATE())" + "SELECT CAST(scope_identity() AS int)"));

            //循环收件箱
            string sto = UserID.Text;

            sto = sto.TrimEnd(',');

            int i = 0;

            for (i = 0; i < (sto.Split(',')).Length; i++)
            {
                SqlHelper.ExecuteSql("INSERT INTO hk_Mail_JS(ssyjid,jsr,jsrIDs,jsrNames,jsbt,jsnr,zyjb,jszt,scbz,msbz,yjfj,jslx,fsrID,fsrName,fssj) VALUES('" + iYjid + "','" + sto.Split(',')[i] + "','" + hkdb.GetStr(UserID.Text) + "','" + hkdb.GetStr(UserName.Text) + "','" + hkdb.GetStr(bt.Text) + "','" + editor.Value + "','" + zyx.SelectedValue + "','0','否','" + hkdb.GetValueChk_Str(msbz.Checked) + "','" + hkdb.GetStr(Number.Text) + "','内部邮件','" + this.Session["UserID"] + "','" + this.Session["UserName"] + "',GETDATE())");
            }

            //Msg
            if (xxtz.Checked == true | dxtz.Checked == true)
            {
                string message = this.Session["username"].ToString() + "给您发了一封站内新邮件,请查收!";
                hkdb.SendMsg(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), sto, message);
            }

            mydb.Alert_Close("发送成功!");
        }
Beispiel #6
0
        //保存
        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;
        }
Beispiel #7
0
        //确认变更
        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;
            }

            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) + "',BGYY='" + hkdb.GetStr(bgyy.Text) + "',bgr='" + this.Session["UserID"] + "',bgsj=GETDATE() WHERE SID='" + hkdb.GetStr(Request.QueryString["id"]) + "'");

            mydb.Alert_Refresh_Close("保存成功!", "Kqsmbg.aspx");
        }
Beispiel #8
0
        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");
            }
        }
Beispiel #9
0
        //保存
        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");
        }