Пример #1
0
        //提交 BG_STATE:1为已提交,2为一级审核通过,3为二级审核通过,4为三级审核通过,5为驳回
        protected void btn_tj_Click(object sender, EventArgs e)
        {
            List <string> listtj = new List <string>();

            for (int r = 0; r < rptProNumCost.Items.Count; r++)
            {
                string ptctj = (rptProNumCost.Items[r].FindControl("Aptcode") as System.Web.UI.WebControls.TextBox).Text;
                string sqltj = "update TBPC_BG set BG_STATE='1' where BG_PTC='" + ptctj + "' and BG_PH='" + ph + "'";
                listtj.Add(sqltj);
            }
            DBCallCommon.ExecuteTrans(listtj);

            //邮件提醒
            string sprid     = "";
            string sptitle   = "";
            string spcontent = "";

            sptitle   = "物料减少审批";
            spcontent = "有物料减少需要您审批,请登录查看!";
            string sqlgetshraname = "select BG_SHRA from TBPC_BG where BG_PH='" + ph + "'";

            System.Data.DataTable dtgetshraname = DBCallCommon.GetDTUsingSqlText(sqlgetshraname);
            if (dtgetshraname.Rows.Count > 0)
            {
                string sqlgetstid = "select ST_ID from TBDS_STAFFINFO where ST_NAME='" + dtgetshraname.Rows[0]["BG_SHRA"].ToString().Trim() + "'";
                System.Data.DataTable dtgetstid = DBCallCommon.GetDTUsingSqlText(sqlgetstid);
                if (dtgetstid.Rows.Count > 0)
                {
                    sprid = dtgetstid.Rows[0]["ST_ID"].ToString().Trim();
                }
                DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(sprid), new List <string>(), new List <string>(), sptitle, spcontent);
            }
            Response.Redirect("PC_TBPC_Purchaseplan_start.aspx");
        }
        protected void btnqueren_Click(object sender, EventArgs e)
        {
            if (tbreason.Text.Trim() == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('请填写修改原因!')", true);
                return;
            }
            //2017.5.12修改,修改发给部长,没部长发给人本人通知
            string str = "select ST_ID from TBDS_STAFFINFO where ST_POSITION='0501' and ST_PD='0'";

            System.Data.DataTable leader = DBCallCommon.GetDTUsingSqlText(str);
            string lead = "";

            if (leader.Rows.Count > 0)
            {
                lead = leader.Rows[0][0].ToString();
            }
            if (!string.IsNullOrEmpty(lead))
            {
                string content = "订单号:" + LabelCode.Text.Trim() + ",修改原因及内容:" + tbreason.Text.Trim() + "。";
                DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(lead), new List <string>(), new List <string>(), "订单数据修改", content);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('采购部暂时无部长,请及时与负责人沟通!');", true);
                return;
            }
        }
Пример #3
0
        protected void btnIn_Click(object sender, EventArgs e)
        {
            List <string> list = new List <string>();
            List <string> sql  = new List <string>();

            foreach (RepeaterItem rptItem in Repeater1.Items)
            {
                CheckBox chk = (CheckBox)rptItem.FindControl("chk");
                if (chk.Checked)
                {
                    list.Add(((Label)rptItem.FindControl("CM_ID")).Text);
                    string    sql1 = "select * from TBCM_CUSTOMER where CM_ID='" + ((Label)rptItem.FindControl("CM_ID")).Text + "'";
                    DataTable dt   = DBCallCommon.GetDTUsingSqlText(sql1);
                    DataRow   dr   = dt.Rows[0];
                    DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID("174"), new List <string>(), new List <string>(), "顾客财产已入库", "项目为" + dr["CM_PJNAME"].ToString() + "请登录系统进行查看。");//刘学的ST_ID
                }
            }
            for (int i = 0; i < list.Count; i++)
            {
                string sqlTxt = "update TBCM_CUSTOMER set CM_BTIN='1' where CM_ID='" + list[i] + "'";
                sql.Add(sqlTxt);
            }
            DBCallCommon.ExecuteTrans(sql);
            bindGrid();
            ScriptManager.RegisterStartupScript(this.Page, GetType(), DateTime.Now.ToString("ssffff"), "sTable()", true);
        }
Пример #4
0
        protected void btnSubmit_OnClick(object sender, EventArgs e)
        {
            string        uprice;
            string        tprice;
            string        rowid;
            List <string> list_sql = new List <string>();

            if (price != '0')
            {
                for (int i = 0; i < GridView1.Rows.Count; i++)
                {
                    GridViewRow gr = GridView1.Rows[i];
                    uprice  = ((TextBox)gr.FindControl("txtUprice")).Text.ToString();
                    tprice  = ((TextBox)gr.FindControl("txtTprice")).Text.ToString();
                    rowid   = ((Label)gr.FindControl("lblid")).Text.ToString();
                    sqltext = "update TBOM_GDZCPCAPPLY set [UPRICE]='" + uprice + "',[TPRICE]='" + tprice + "',[SHRID]='" + shrid.Value + "',[SHR]='" + txtshr.Text + "',[STATE]=1 where [ID]='" + rowid + "'";
                    list_sql.Add(sqltext);
                }
                sqltext = "update TBOM_GDZCRVW set CARRVWA='" + txtshr.Text.Trim() + "',CARRVWAID='" + shrid.Value.Trim() + "',STATUS='1' where CODE='" + lblCode.Text.Trim() + "'";
                list_sql.Add(sqltext);
                DBCallCommon.ExecuteTrans(list_sql);
                string _emailto = DBCallCommon.GetEmailAddressByUserID(firstid.Value);
                string _body    = "固定资产采购审批任务:"
                                  + "\r\n单号:" + lblCode.Text.ToString().Trim()
                                  + "\r\n制单日期:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                string _subject = "您有新的【固定资产采购】需要审批,请及时处理:" + lblCode.Text.ToString().Trim();
                DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('提交成功,请等待审批!');window.location.href='OM_GdzcPcPlan.aspx'", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('请填写金额!!!');", true);
            }
        }
Пример #5
0
 private void SendEmail()
 {
     if (action == "cancel")
     {
         string    sql = " select * from TBCM_PLAN where ID='" + id + "'";
         DataTable dt  = DBCallCommon.GetDTUsingSqlText(sql);
         foreach (ListItem item in CheckBoxList0.Items)
         {
             if (item.Selected)
             {
                 DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(item.Value), new List <string>(), new List <string>(), "经营计划单取消通知", "合同号为“" + dt.Rows[0]["CM_CONTR"].ToString() + "”存在取消的部分,请登录系统“市场管理”模块中的“取消评审中查看”");
             }
         }
         //jishubu
         foreach (ListItem item in CheckBoxList1.Items)
         {
             if (item.Selected)
             {
                 DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(item.Value), new List <string>(), new List <string>(), "经营计划单取消通知", "合同号为“" + dt.Rows[0]["CM_CONTR"].ToString() + "”存在取消的部分,请登录系统“市场管理”模块中的“取消评审中查看”");
             }
         }
         //zhiliangbu
         foreach (ListItem item in CheckBoxList6.Items)
         {
             if (item.Selected)
             {
                 DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(item.Value), new List <string>(), new List <string>(), "经营计划单取消通知", "合同号为“" + dt.Rows[0]["CM_CONTR"].ToString() + "”存在取消的部分,请登录系统“市场管理”模块中的“取消评审中查看”");
             }
         }
         foreach (ListItem item in CheckBoxList2.Items)
         {
             if (item.Selected)
             {
                 DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(item.Value), new List <string>(), new List <string>(), "经营计划单取消通知", "合同号为“" + dt.Rows[0]["CM_CONTR"].ToString() + "”存在取消的部分,请登录系统“市场管理”模块中的“取消评审中查看”");
             }
         }
         foreach (ListItem item in CheckBoxList3.Items)
         {
             if (item.Selected)
             {
                 DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(item.Value), new List <string>(), new List <string>(), "经营计划单取消通知", "合同号为“" + dt.Rows[0]["CM_CONTR"].ToString() + "”存在取消的部分,请登录系统“市场管理”模块中的“取消评审中查看”");
             }
         }
         foreach (ListItem item in CheckBoxList4.Items)
         {
             if (item.Selected)
             {
                 DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(item.Value), new List <string>(), new List <string>(), "经营计划单取消通知", "合同号为“" + dt.Rows[0]["CM_CONTR"].ToString() + "”存在取消的部分,请登录系统“市场管理”模块中的“取消评审中查看”");
             }
         }
         foreach (ListItem item in CheckBoxList5.Items)
         {
             if (item.Selected)
             {
                 DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(item.Value), new List <string>(), new List <string>(), "经营计划单取消通知", "合同号为“" + dt.Rows[0]["CM_CONTR"].ToString() + "”存在取消的部分,请登录系统“市场管理”模块中的“取消评审中查看”");
             }
         }
         DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID("47"), new List <string>(), new List <string>(), "经营计划单取消审批", "合同号为“" + dt.Rows[0]["CM_CONTR"].ToString() + "”存在取消的部分,请登录系统“市场管理”模块中的“取消评审”审批");
     }
 }
        //审核2
        protected void btnsh2_click(object sender, EventArgs e)
        {
            if (rblsecond.SelectedValue == "0")
            {
                string sql2 = "update TBPC_BG set BG_STATE='3',RESULT='审核中',BG_SHRB='" + name + "',BG_SHRIDB='" + userid + "',BG_SHYJB='" + second_opinion.Text.ToString() + "',BG_SHDATEB='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "' where BG_PH='" + ph + "'";
                DBCallCommon.ExeSqlText(sql2);

                //邮件提醒
                string sprid     = "";
                string sptitle   = "";
                string spcontent = "";
                sptitle   = "物料减少审批";
                spcontent = "有物料减少需要您审批,请登录查看!";
                string sqlgetstid = "select ST_ID from TBDS_STAFFINFO where ST_NAME='" + rblthird.Text.Trim() + "'";
                System.Data.DataTable dtgetstid = DBCallCommon.GetDTUsingSqlText(sqlgetstid);
                if (dtgetstid.Rows.Count > 0)
                {
                    sprid = dtgetstid.Rows[0]["ST_ID"].ToString().Trim();
                }
                DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(sprid), new List <string>(), new List <string>(), sptitle, spcontent);
            }
            if (rblsecond.SelectedValue == "1")
            {
                string sqltext2 = "update TBPC_BG set BG_STATE='7',RESULT='已驳回',BG_SHRB='" + name + "',BG_SHRIDB='" + userid + "',BG_SHYJB='" + second_opinion.Text.ToString() + "',BG_SHDATEB='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "' where BG_PH='" + ph + "'";
                DBCallCommon.ExeSqlText(sqltext2);
                btnsh2.Visible = false;
            }
            binddata();
            zxztbind();
            kjifvisible();
            Response.Redirect("PC_TBPC_Purchange_new.aspx");
        }
        //提交
        protected void btnSubmit_OnClick(object sender, EventArgs e)
        {
            List <string> list   = new List <string>();
            string        sql001 = "";

            spbh = Request.QueryString["spid"].ToString().Trim();
            string    sqltext = "select * from OM_CanBuYDSP where SPBH='" + spbh.ToString().Trim() + "'";
            DataTable dt      = DBCallCommon.GetDTUsingSqlText(sqltext);

            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["SQR_ID"].ToString().Trim() == Session["UserID"].ToString().Trim())
                {
                    if (txt_first.Text.Trim() == "" || firstid.Value.Trim() == "")
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('请选择审批人!');", true);
                        return;
                    }
                    else
                    {
                        sql001 = "update OM_CanBuYDSP set TotalState='1',SQR_Note='" + txtfqryj.Text.Trim() + "',SPR_ID='" + firstid.Value.Trim() + "',SPR_Name='" + txt_first.Text.Trim() + "' where SPBH='" + spbh.ToString().Trim() + "'";
                        list.Add(sql001);

                        //邮件提醒
                        string sprid     = "";
                        string sptitle   = "";
                        string spcontent = "";
                        sprid     = firstid.Value.Trim();
                        sptitle   = "餐补异动审批";
                        spcontent = lb_title.Text.Trim() + "的餐补异动需要您审批,请登录查看!";
                        DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(sprid), new List <string>(), new List <string>(), sptitle, spcontent);
                    }
                }
                if (dt.Rows[0]["SPR_ID"].ToString().Trim() == Session["UserID"].ToString().Trim())
                {
                    if (rblfirst.SelectedValue.ToString().Trim() == "1")
                    {
                        sql001 = "update OM_CanBuYDSP set SPR_State='" + rblfirst.SelectedValue.ToString().Trim() + "',TotalState='2',SP_Time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Trim() + "',SPR_Note='" + opinion1.Text.Trim() + "' where SPBH='" + spbh.ToString().Trim() + "'";
                        list.Add(sql001);
                        updatecbsj(spbh);
                    }
                    else if (rblfirst.SelectedValue.ToString().Trim() == "2")
                    {
                        sql001 = "update OM_CanBuYDSP set SPR_State='" + rblfirst.SelectedValue.ToString().Trim() + "',TotalState='3',SP_Time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Trim() + "',SPR_Note='" + opinion1.Text.Trim() + "' where SPBH='" + spbh.ToString().Trim() + "'";
                        list.Add(sql001);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('请选择审核意见!');", true);
                        return;
                    }
                }
            }
            DBCallCommon.ExecuteTrans(list);
            Response.Redirect("OM_CanBuYDSPdetail.aspx?spid=" + spbh);
        }
Пример #8
0
        private void SendEmail()
        {
            string csr = HidCSR.Value;

            string[] str = csr.Split(',');
            for (int i = 0; i < str.Length; i++)
            {
                DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(str[i]), new List <string>(), new List <string>(), "您有发货通知需要查看", "编号为 " + CM_BIANHAO.Text + ",顾客名称为 " + CM_CUSNAME.Text + " 的发货通知已审批通过,请登录系统查看。");
            }
        }
Пример #9
0
        private void SendEmailTo(string p)
        {
            string _emailto = DBCallCommon.GetEmailAddressByUserID(p);
            string _body    = "开票管理审批任务:"
                              + "\r\n编    号:" + KP_CODE.Text.Trim()
                              + "\r\n制    单:" + KP_ZDRNM.Text.Trim() + "";

            string _subject = "您有新的【增值税发票申请单】需要审批,请及时处理";

            DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
        }
Пример #10
0
        private void writedata()
        {
            List <string> list_sql = new List <string>();

            for (int i = 0; i < Repeater1.Items.Count; i++)
            {
                if (((TextBox)Repeater1.Items[i].FindControl("txt_shuliang")).Text != "")
                {
                    mingchen = ((Label)Repeater1.Items[i].FindControl("lblbh")).Text;
                    guige    = ((Label)Repeater1.Items[i].FindControl("lblName")).Text;;
                    danjia   = ((Label)Repeater1.Items[i].FindControl("lbldanjia")).Text;
                    danwei   = ((Label)Repeater1.Items[i].FindControl("lbdanwei")).Text;
                    shuliang = ((TextBox)Repeater1.Items[i].FindControl("txt_shuliang")).Text;
                    double dj = CommonFun.ComTryDouble(danjia);
                    double sl = CommonFun.ComTryDouble(shuliang);
                    //比较库存数量与出库数量大小
                    string    sql   = "select * from OM_CARKUCUN where KC_MC='" + mingchen + "' and KC_GG='" + guige + "'and KC_DJ='" + dj + "'";
                    DataTable dt    = DBCallCommon.GetDTUsingSqlText(sql);
                    string    kc_sl = dt.Rows[0]["KC_SL"].ToString();
                    double    kcsl  = CommonFun.ComTryDouble(kc_sl);
                    if (kcsl >= sl)
                    {
                        double zongjia = dj * sl;
                        string zj      = zongjia.ToString();

                        //string sqltext = "insert into OM_CARKUCUN(KC_MC,KC_GG,KC_SL,KC_DJ,KC_ZJ,KC_SJ)";
                        //sqltext += "values('" + mingchen + "','" + guige + "','" + shuliang + "','" + danjia + "','" + zongjia + "','" + lblInDate.Text + "')";
                        //list_sql.Add(sqltext);


                        string sqltext1 = string.Format("insert into OM_CARCK_SP (SP_MC,SP_GG,SP_SL,ZDR,ZDRID,ZDR_SJ,ZDR_JY,SPR1,SPR1_ID,SPR1_JL,SPR1_JY,SPR2,SPR2_ID,SPR2_JL,SPR2_JY,SP_DJ,SP_DANWEI,SPJB,SPZT,SP_ZJ) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}')", mingchen, guige, shuliang, txtZDR.Text.Trim(), hidZDRID.Value, lbZDR_SJ.Text, txtZDR_JY.Text.Trim(), txtSPR1.Text.Trim(), hidSPR1_ID.Value, "", "", txtSPR2.Text.Trim(), hidSPR2_ID.Value, "", "", danjia, danwei, rblSPJB.SelectedValue, "0", zj);
                        list_sql.Add(sqltext1);
                    }
                    else
                    {
                        Response.Write("<script>alert('库存数量不足,请查看正确数量!!!')</script>");
                        Response.Redirect("OM_CarKuCun.aspx");
                    }
                }
                else
                {
                    Response.Write("<script>alert('请选择“名称、数量”再提交!!!')</script>");
                }
            }
            DBCallCommon.ExecuteTrans(list_sql);
            string _emailto = DBCallCommon.GetEmailAddressByUserID(hidSPR1_ID.Value);
            string _body    = "车品出库审批任务:"
                              + "\r\n制单人:" + lbl_creater.Text.Trim()
                              + "\r\n制单日期:" + lblInDate.Text.Trim();

            string _subject = "您有新的【车品出库】需要审批,请及时处理";

            DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
        }
Пример #11
0
        protected void btn_submit_click(object sender, EventArgs e)
        {
            if (asd.action == "add")
            {
                List <string> list = addlist();
                try
                {
                    DBCallCommon.ExecuteTrans(list);
                    string _emailto = DBCallCommon.GetEmailAddressByUserID(hidSPR1ID.Value);
                    string _body    = "非固定资产转移审批任务:"
                                      + "\r\n制单人:" + txtZDR.Text.Trim()
                                      + "\r\n制单日期:" + lbZDR_SJ.Text.Trim();

                    string _subject = "您有新的【非固定资产转移】需要审批,请及时处理";
                    DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
                }
                catch
                {
                    Response.Write("<script>alert('添加转移成功');</script>");
                    return;
                }
                Response.Redirect("OM_FGdzcTransSum.aspx");
            }
            else if (asd.action == "check")
            {
                List <string> list = checklist();
                try
                {
                    DBCallCommon.ExecuteTrans(list);
                }
                catch
                {
                    Response.Write("<script>alert('审批语句出现问题,请与管理员联系!!!');</script>");
                    return;
                }
                list.Clear();
                string    sql = string.Format("select * from TBOM_GDZCTRANSFER as a left join OM_SP as b on a.DH=b.SPFATHERID where TRANSFTYPE='1' and SPFATHERID ='{0}'", asd.id);
                DataTable dt  = DBCallCommon.GetDTUsingSqlText(sql);
                if (dt.Rows[0]["SPZT"].ToString() == "y")
                {
                    list = zylist();
                    try
                    {
                        DBCallCommon.ExecuteTrans(list);
                    }
                    catch
                    {
                        Response.Write("<script>alert('转移语句出现问题,请与管理员联系!!!');</script>");
                        return;
                    }
                }
                Response.Redirect("OM_FGDZCZY_SP.aspx");
            }
        }
Пример #12
0
        /// <summary>
        /// 发送邮件
        /// </summary>
        /// <param name="emailto">收件人ID</param>
        /// <param name="theme">操作主题</param>
        /// <param name="operation">操作类型</param>
        /// <param name="code">单号</param>
        /// <param name="maker">制单人</param>
        /// <param name="time">制单日期</param>
        private void SendMail(string emailto, string theme, string operation, string code, string maker, string time)
        {
            string _emailto = DBCallCommon.GetEmailAddressByUserID(emailto);
            string _body    = theme + operation + "任务:"
                              + "\r\n单号:" + code
                              + "\r\n制单人:" + maker
                              + "\r\n制单日期:" + time;

            string _subject = "您有新的【" + theme + "】需要" + operation + ",请及时处理";

            DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
        }
Пример #13
0
        private void writedata()
        {
            List <string> list_sql = new List <string>();

            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                GridViewRow gr = GridView1.Rows[i];
                if (((TextBox)gr.FindControl("txt_Name")).Text != "")
                {
                    code    = ((DropDownList)gr.FindControl("ddl_code")).SelectedValue;
                    bianhao = ((TextBox)gr.FindControl("txt_bianhao")).Text;
                    nx      = ((TextBox)gr.FindControl("txt_nx")).Text;
                    jiazhi  = ((TextBox)gr.FindControl("txt_jiazhi")).Text;
                    name    = ((TextBox)gr.FindControl("txt_Name")).Text;
                    model   = ((TextBox)gr.FindControl("txt_Model")).Text;
                    note    = ((TextBox)gr.FindControl("txt_Note")).Text;
                    DropDownList ss = (DropDownList)gr.FindControl("ddl_user");
                    bumen = ((DropDownList)gr.FindControl("ddl_bumen")).SelectedItem.Text;
                    place = ((TextBox)gr.FindControl("txt_place")).Text;
                    syrid = ((HtmlInputHidden)gr.FindControl("hidSyrId")).Value;
                    string bumenid = ((DropDownList)gr.FindControl("ddl_bumen")).SelectedValue;
                    syr = ((HtmlInputHidden)gr.FindControl("hidSyr")).Value;
                    string type  = ((TextBox)gr.FindControl("txtType")).Text;
                    string type2 = ((TextBox)gr.FindControl("txtType2")).Text;

                    //if (innum == 0.0)
                    //{
                    //    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('提示:无法保存!!!没有入库数据!!!');", true);
                    //    return;
                    //}
                    //else
                    //{
                    sqltext  = "insert into TBOM_GDZCIN(INCODE,CODE,NAME,MODEL,PLACE,BIANHAO,SYBUMEN,SYBUMENID,SYR,SYRID,CREATER,CREATERID,INDATE,NOTE,JLR,JLRID,SYDATE,NX,JIAZHI,INTYPE,TYPE,TYPE2)";
                    sqltext += "values('" + lblInCode.Text + "','" + code + "','" + name + "','" + model + "','" + place + "','" + bianhao + "','" + bumen + "','" + bumenid + "','" + syr + "','" + syrid + "','" + lbl_creater.Text + "','" + Session["UserID"].ToString() + "','" + lblInDate.Text + "','" + note + "','" + txtshr.Text + "','" + shrid.Value + "','" + lblInDate.Text + "','" + nx + "','" + jiazhi + "','0','" + type + "','" + type2 + "')";
                    list_sql.Add(sqltext);
                    //sqltext = "update TBOM_GDZCSTORE set NUMSTORE=" + numstore + " where NAME='" + name + "'and MODEL='" + model + "'";
                    //list_sql.Add(sqltext);
                    //}
                }
            }
            sqltext = string.Format("insert into OM_SP (SPFATHERID,SPLX,SPJB,ZDR,ZDRID,ZDR_SJ,ZDR_JY,SPR1,SPR1ID,SPR1_JL,SPR1_SJ,SPR1_JY,SPR2,SPR2ID,SPR2_JL,SPR2_SJ,SPR2_JY,SPR3,SPR3ID,SPR3_JL,SPR3_SJ,SPR3_JY,SPZT) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}','{21}','{22}')", lblInCode.Text, "GDZC", rblSPJB.SelectedValue, txtZDR.Text.Trim(), hidZDRID.Value, lbZDR_SJ.Text, txtZDR_JY.Text.Trim(), txtSPR1.Text.Trim(), hidSPR1ID.Value, "", "", "", txtSPR2.Text.Trim(), hidSPR2ID.Value, "", "", "", txtSPR3.Text.Trim(), hidSPR3ID.Value, "", "", "", "0");
            list_sql.Add(sqltext);
            DBCallCommon.ExecuteTrans(list_sql);
            string _emailto = DBCallCommon.GetEmailAddressByUserID(hidSPR1ID.Value);
            string _body    = "固定资产入库审批任务:"
                              + "\r\n制单人:" + lbl_creater.Text.Trim()
                              + "\r\n制单日期:" + lblInDate.Text.Trim();

            string _subject = "您有新的【固定资产入库】需要审批,请及时处理";

            DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
        }
Пример #14
0
        private void SendEmailToSHR(string ID)
        {
            //邮件提醒
            string _emailto = DBCallCommon.GetEmailAddressByUserID(ID);
            string _body    = "办公用品汇总审批任务:"
                              + "\r\n编    号:" + LabelCode.Text
                              + "\r\n制单人:" + LabelDoc.Text
                              + "\r\n制单日期:" + TextBoxDate.Text
                              + "\r\n总额: " + lbljine.Text.Trim();

            string _subject = "您有新的【办公用品汇总】需要审批,请及时处理:" + LabelCode.Text;

            DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
        }
        //审批
        protected void btnAudit_Click(object sender, EventArgs e)
        {
            if (Checked())
            {
                string sql = "";
                if (hidAction.Value == "add")
                {
                    List <string> list = new List <string>();
                    for (int i = 0; i < hidConext.Value.Trim('|').Split('|').Length; i++)
                    {
                        if (ddl_zipstate.SelectedValue.ToString().Trim() == "1" && rblSHJS.SelectedValue.ToString().Trim() != "0")
                        {
                            sql = "update TBDS_KaoHeList set Kh_state='2',Kh_shtoltalstate='1' where kh_Context='" + hidConext.Value.Split('|')[i].ToString() + "'";
                        }
                        else if (ddl_zipstate.SelectedValue.ToString().Trim() == "0" && rblSHJS.SelectedValue.ToString().Trim() != "0")
                        {
                            sql = "update TBDS_KaoHeList set Kh_state='1',Kh_shtoltalstate='1' where kh_Context='" + hidConext.Value.Split('|')[i].ToString() + "'";
                        }
                        else if (ddl_zipstate.SelectedValue.ToString().Trim() == "1" && rblSHJS.SelectedValue.ToString().Trim() == "0")
                        {
                            sql = "update TBDS_KaoHeList set Kh_state='2',Kh_shtoltalstate='2' where kh_Context='" + hidConext.Value.Split('|')[i].ToString() + "'";
                        }
                        else if (ddl_zipstate.SelectedValue.ToString().Trim() == "0" && rblSHJS.SelectedValue.ToString().Trim() == "0")
                        {
                            sql = "update TBDS_KaoHeList set Kh_state='1',Kh_shtoltalstate='2' where kh_Context='" + hidConext.Value.Split('|')[i].ToString() + "'";
                        }
                        else
                        {
                            sql = "update TBDS_KaoHeList set Kh_state='1',Kh_shtoltalstate='1' where kh_Context='" + hidConext.Value.Split('|')[i].ToString() + "'";
                        }
                        list.Add(sql);
                    }


                    DBCallCommon.ExecuteTrans(list);

                    //邮件提醒
                    string sprid     = "";
                    string sptitle   = "";
                    string spcontent = "";
                    sprid     = firstid.Value.Trim();
                    sptitle   = "考核人评价项审批";
                    spcontent = "有" + txtKhNianYue.Text.Trim() + "的" + lbtitle.Text.Trim() + "需要您审批,请登录查看!";
                    DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(sprid), new List <string>(), new List <string>(), sptitle, spcontent);
                    Response.Write("<script>alert('保存成功!');window.location.href='OM_KaoHeList.aspx';</script>");
                }
            }
        }
Пример #16
0
        protected void btnsubmit_Click(object sender, EventArgs e)
        {
            string part = string.Empty;

            for (int i = 0; i < CM_CLPART.Items.Count; i++)
            {
                if (CM_CLPART.Items[i].Selected)
                {
                    part += "," + CM_CLPART.Items[i].Value;//这里是选中的项
                }
            }
            if (part != "")
            {
                part = part.Substring(1);
            }
            string sql = "";

            if (Session["UserID"].ToString() == market)
            {
                string review1 = bmspnr.Text + "△" + bmsprq.Text;
                if (bmsp.SelectedValue == "2")
                {
                    sql = string.Format("update TBCM_APPLICA set CM_COMMAND='{0}',CM_BUMENYJ='{1}',CM_CLPART='{2}',CM_YJ11='2' where CM_ID='{3}'", CM_COMMAND.Text, review1, part, id);
                    DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(leader), new List <string>(), new List <string>(), "顾客联系单申请审批", "您有顾客服务联系单需要审批,请登录系统进行查看。");
                }
                else if (bmsp.SelectedValue == "3")
                {
                    sql = string.Format("update TBCM_APPLICA set CM_COMMAND='{0}',CM_BUMENYJ='{1}',CM_YJ11='3',CM_STATE='3' where CM_ID='{2}'", CM_COMMAND.Text, review1, id);
                }
            }
            else if (Session["UserID"].ToString() == leader)
            {
                string review2 = ldspnr.Text + "△" + lzsprq.Text;
                if (ldsp.SelectedValue == "2")
                {
                    sql = string.Format("update TBCM_APPLICA set CM_COMMAND='{0}',CM_LEADYJ='{1}',CM_CLPART='{2}',CM_YJ2='2',CM_STATE='2' where CM_ID='{3}'", CM_COMMAND.Text, review2, part, id);
                }
                else if (ldsp.SelectedValue == "3")
                {
                    sql = string.Format("update TBCM_APPLICA set CM_COMMAND='{0}',CM_LEADYJ='{1}',CM_CLPART='{2}',CM_YJ2='3',CM_STATE='3' where CM_ID='{3}'", CM_COMMAND.Text, review2, part, id);
                }
            }
            if (sql != "")
            {
                DBCallCommon.ExeSqlText(sql);
            }
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('审批成功!');window.opener.location.reload();window.opener=null;window.open('','_self');window.close();", true);
        }
Пример #17
0
 private void SendEmail()
 {
     if (action == "add")
     {
         string UserID = GetUserID(txtTZD_SPR1.Text.Trim());
         DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(UserID), new List <string>(), new List <string>(), "生产代用通知", "您有生产代用通知“" + lbTZD_PH.Text.Trim() + "”需要审批,请登录系统,进入技术管理模块的“生产通知审批”进行查看。");
     }
     if (action == "check")
     {
         string UserID = GetUserID(txtTZD_SPR2.Text.Trim());
         if (username == dts.Rows[0]["TZD_SPR1"].ToString() && rblTZD_SPR1_JL.SelectedValue == "1")
         {
             DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(UserID), new List <string>(), new List <string>(), "生产代用通知", "您有生产代用通知“" + dts.Rows[0]["TZD_PH"].ToString() + "”需要审批,请登录系统,进入技术管理模块的“生产通知审批”进行查看。");
         }
     }
 }
Пример #18
0
        protected void btnedit_Click(object sender, EventArgs e)
        {
            string sql = "update TBCM_CUSTOMER set CM_ZDYJ='" + CM_ZDYJ.Text + "',CM_SFHG='" + CM_SFHG.SelectedValue + "' where CM_ID='" + Request.QueryString["CM_ID"] + "'";

            if (CM_SFHG.SelectedValue == "1")
            {
                if (psr.Value != "")
                {
                    string[] strs = psr.Value.Split(',');
                    for (int i = 0; i < strs.Length; i++)
                    {
                        DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(strs[i]), new List <string>(), new List <string>(), "顾客财产继续使用", "项目为 " + CM_PJNAME.Text + ",入库内容为 " + CM_INCONT.Text + ",已由市场部改为合格,可继续使用,请登录系统查看");
                    }
                }
            }
            DBCallCommon.ExeSqlText(sql);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('信息修改成功!');window.opener=null;window.open('','_self');window.close();", true);
        }
Пример #19
0
        private void writedata()
        {
            List <string> list_sql = new List <string>();

            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                GridViewRow gr = GridView1.Rows[i];

                if (((TextBox)gr.FindControl("txt_mingchen")).Text != "" && ((TextBox)gr.FindControl("txt_shuliang")).Text != "")
                {
                    mingchen = ((TextBox)gr.FindControl("txt_mingchen")).Text;
                    guige    = ((TextBox)gr.FindControl("txt_guige")).Text;
                    shuliang = ((TextBox)gr.FindControl("txt_shuliang")).Text;
                    danjia   = ((TextBox)gr.FindControl("txt_danjia")).Text;
                    danwei   = ((TextBox)gr.FindControl("txt_danwei")).Text;
                    double dj      = CommonFun.ComTryDouble(danjia);
                    double sl      = CommonFun.ComTryDouble(shuliang);
                    double zongjia = dj * sl;
                    string zj      = zongjia.ToString();

                    //string sqltext = "insert into OM_CARKUCUN(KC_MC,KC_GG,KC_SL,KC_DJ,KC_ZJ,KC_SJ)";
                    //sqltext += "values('" + mingchen + "','" + guige + "','" + shuliang + "','" + danjia + "','" + zongjia + "','" + lblInDate.Text + "')";
                    //list_sql.Add(sqltext);


                    string sqltext1 = string.Format("insert into OM_CARRK_SP (SP_MC,SP_GG,SP_SL,ZDR,ZDRID,ZDR_SJ,ZDR_JY,SPR1,SPR1_ID,SPR1_JL,SPR1_JY,SPR2,SPR2_ID,SPR2_JL,SPR2_JY,SP_DJ,SP_DANWEI,SPJB,SPZT,SP_ZJ) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}')", mingchen, guige, shuliang, txtZDR.Text.Trim(), hidZDRID.Value, lbZDR_SJ.Text, txtZDR_JY.Text.Trim(), txtSPR1.Text.Trim(), hidSPR1_ID.Value, "", "", txtSPR2.Text.Trim(), hidSPR2_ID.Value, "", "", danjia, danwei, rblSPJB.SelectedValue, "0", zj);
                    list_sql.Add(sqltext1);
                }
                else
                {
                    Response.Write("<script>alert('请选择“名称、数量”再提交!!!')</script>");
                }
            }
            DBCallCommon.ExecuteTrans(list_sql);
            string _emailto = DBCallCommon.GetEmailAddressByUserID(hidSPR1_ID.Value);
            string _body    = "车品入库审批任务:"
                              + "\r\n制单人:" + lbl_creater.Text.Trim()
                              + "\r\n制单日期:" + lblInDate.Text.Trim();

            string _subject = "您有新的【车品入库】需要审批,请及时处理";

            DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
        }
Пример #20
0
 protected void btnConfirm_Click(object sender, EventArgs e)
 {
     if (Check())
     {
         BindReviewer();//读出评审人员
         List <string> str_sql = new List <string>();
         string        sql     = "";
         string        code    = DateTime.Now.ToString("yyyyMMddhhmmss");
         //删除信息
         if (!string.IsNullOrEmpty(psId))
         {
             sql = "delete from TBDS_DETAIL where ST_ID='" + psId + "'";
             str_sql.Add(sql);
             sql = "delete from TBDS_VIEW where ST_ID='" + psId + "'";
             str_sql.Add(sql);
         }
         //信息总表
         sql = string.Format("insert into TBDS_PSDETAIL(ST_ID,ST_PER,ST_CONT,ST_REMARK,ST_ZDR,ST_ZDSJ,ST_TYPE)  values('{0}','{1}','{2}','{3}','{4}','{5}','0')", code, Id, ST_ZHENG.Text, ST_REMARK.Text, Session["UserID"].ToString(), DateTime.Now.ToString("yyyy-MM-dd"));
         str_sql.Add(sql);
         //合同评审信息详细表(TBDS_PSVIEW)
         sql = "insert into TBDS_PSVIEW values('" + code + "','" + Session["UserID"].ToString() + "','2','" + txt_zdrYJ.Text + "','" + DateTime.Now.ToString("yyyy-MM-dd") + "','" + Session["UserDeptID"].ToString() + "','0')";
         str_sql.Add(sql);  //制单人意见
         for (int i = 0; i < reviewer.Count; i++)
         {
             /******************通过键来找值******************************************************/
             /**为了兼容领导同时为部门负责人的情况,评审人部门编号要以评审人员设置表中为准,而不以当前登录人部门编号为依据**/
             string    sql_dep = "select dep_id from TBCM_HT_SETTING where per_id='" + reviewer.Values.ElementAt(i) + "' and per_sfjy=0 and per_type='3'";
             DataTable dt_dep  = DBCallCommon.GetDTUsingSqlText(sql_dep);
             if (dt_dep.Rows.Count > 0)
             {
                 sql = "insert into TBDS_PSVIEW(ST_ID,ST_PID,ST_DEP,ST_PIDTYPE) values('" + code + "','" + reviewer.Values.ElementAt(i) + "','" + dt_dep.Rows[0]["dep_id"].ToString().Substring(0, 2) + "','1')";
                 str_sql.Add(sql);//其他人
                 if (dt_dep.Rows[0]["dep_id"].ToString().Substring(0, 2) != "01")
                 {
                     DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(reviewer.Values.ElementAt(i)), new List <string>(), new List <string>(), "转正审批", "您有转正信息需要审批,请登录系统进行查看。");
                 }
             }
         }
         DBCallCommon.ExecuteTrans(str_sql);
         ////Response.Write("<script>window.opener.location.reload();window.close();</script>");//刷新
         Response.Write("<script>alert('添加审批成功!');window.close();</script>");
     }
 }
        //审批
        protected void btnAudit_Click(object sender, EventArgs e)
        {
            string sql   = "";
            string state = "";

            if (hidAction.Value == "add" || hidAction.Value == "edit")
            {
                sql = "update TBDS_KaoheDeaprtMonth set state='1' where Context='" + hidConext.Value + "'";
                DBCallCommon.ExeSqlText(sql);

                //邮件提醒
                string sprid     = "";
                string sptitle   = "";
                string spcontent = "";
                sprid     = firstid.Value.Trim();
                sptitle   = "组织绩效月度成绩审批";
                spcontent = txtKhNianYue.Text.Trim() + "的组织绩效月度成绩需要您审批,请登录查看!";
                DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(sprid), new List <string>(), new List <string>(), sptitle, spcontent);
                Response.Write("<script>alert('保存成功!');window.location.href='OM_KaoHeList_DepartMonth.aspx';</script>");
            }
            else if (action == "audit")
            {
                if (rblResult1.SelectedIndex == -1)
                {
                    Response.Write("<script>alert('请选择审核结果!')</script>");
                    return;
                }
                else
                {
                    if (rblResult1.SelectedValue == "0")
                    {
                        state = "2";
                    }
                    else if (rblResult1.SelectedValue == "1")
                    {
                        state = "3";
                    }
                    sql = "update TBDS_KaoheDeaprtMonth set state='" + state + "',RESULTA='" + rblResult1.SelectedValue + "',TIMEA='" + DateTime.Now.ToString() + "',OPTIONA='" + first_opinion.Text.Trim() + "'  where Context='" + hidConext.Value + "'";
                    DBCallCommon.ExeSqlText(sql);
                    Response.Write("<script>alert('保存成功!');window.location.href='OM_KaoHeList_DepartMonth.aspx';</script>");
                }
            }
        }
        // }



        //protected void tb_pj_Textchanged(object sender, EventArgs e)
        //{
        //    string Cname = "";
        //    if (tb_pj.Text.ToString().Contains("|"))
        //    {
        //        Cname = tb_pj.Text.Substring(0, tb_pj.Text.ToString().IndexOf("|"));
        //        tb_pj.Text = Cname.Trim();
        //    }
        //    else if (tb_pj.Text == "")
        //    {

        //    }
        //}

        //protected void tb_eng_Textchanged(object sender, EventArgs e)
        //{
        //    string Cname = "";
        //    if (tb_eng.Text.ToString().Contains("|"))
        //    {
        //        Cname = tb_eng.Text.Substring(0, tb_eng.Text.ToString().IndexOf("|"));
        //        tb_eng.Text = Cname.Trim();
        //    }
        //    else if (tb_eng.Text == "")
        //    {

        //    }
        //}


        protected void btn_email_click(object sender, EventArgs e)
        {
            //邮件提醒
            string sprid     = "";
            string sptitle   = "";
            string spcontent = "";
            string sqltext   = "select * from TBDS_STAFFINFO where EMAIL is not null and EMAIL!=''";

            System.Data.DataTable dt = DBCallCommon.GetDTUsingSqlText(sqltext);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    sprid     = dt.Rows[i]["ST_ID"].ToString().Trim();
                    sptitle   = "关于ERP程序修改";
                    spcontent = "在提交申请选择审批人时,因为ERP程序上的修改,需要将浏览器缓存清理一下,才能正常选人,所以请大家将浏览器缓存清理一下,给大家带来不便敬请谅解!";
                    DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(sprid), new List <string>(), new List <string>(), sptitle, spcontent);
                }
            }
        }
Пример #23
0
        protected void btntijiao_Click(object sender, EventArgs e)
        {
            string part = string.Empty;

            for (int i = 0; i < CM_CLPART.Items.Count; i++)
            {
                if (CM_CLPART.Items[i].Selected)
                {
                    part += "," + CM_CLPART.Items[i].Value;//这里是选中的项
                }
            }
            if (part != "")
            {
                part = part.Substring(1);
            }
            string sql = string.Format("update TBCM_APPLICA set CM_COMMAND='{0}',CM_BUMEN='{1}',CM_LEADER='{2}',CM_CLPART='{3}',CM_YJ11='1',CM_YJ2='1',CM_STATE='1' where CM_ID='{4}'", CM_COMMAND.Text, market, leader, part, id);

            DBCallCommon.ExeSqlText(sql);
            DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(market), new List <string>(), new List <string>(), "顾客联系单申请审批", "您有顾客服务联系单需要审批,请登录系统进行查看。");
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('提交成功!');window.opener.location.reload();window.opener=null;window.open('','_self');window.close();", true);
        }
Пример #24
0
        protected void btnFYTJ_OnClick(object sender, EventArgs e)
        {
            string CLD_ID   = "";
            string CLD_SPZT = "";
            string CLD_BH   = "";

            for (int i = 0, length = rptSHFWCLD.Items.Count; i < length; i++)
            {
                CheckBox cbx = (CheckBox)rptSHFWCLD.Items[i].FindControl("cbxXuHao");
                if (cbx.Checked)
                {
                    CLD_ID   = ((HtmlInputHidden)rptSHFWCLD.Items[i].FindControl("CLD_ID")).Value;
                    CLD_SPZT = ((HtmlInputHidden)rptSHFWCLD.Items[i].FindControl("CLD_SPZT")).Value;
                    CLD_BH   = ((Label)rptSHFWCLD.Items[i].FindControl("CLD_BH")).Text.Trim();
                    break;
                }
            }
            if (CLD_ID == "")
            {
                Response.Write("<script type='text/javascript'>alert('请勾选一条进行修改!!!')</script>");
                return;
            }
            else
            {
                if (CLD_SPZT == "cljg_y")
                {
                    string sql = "update CM_SHCLD set CLD_FWFY_TJR='" + hidTXR.Value.Trim() + "',";
                    sql += "CLD_FWFY_FGR='" + Session["UserName"].ToString() + "'";
                    sql += " where CLD_ID='" + CLD_ID + "'";
                    DBCallCommon.ExeSqlText(sql);
                    Response.Write("<script type='text/javascript'>alert('您已成功将任务分给了“" + hidTXR.Value + "”!!!')</script>");
                    DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(GetST_ID(hidTXR.Value)), new List <string>(), new List <string>(), "售后质量问题处理通知", "您有售后质量问题处理单“" + CLD_BH + "”需要填写“费用统计”,请登录系统,进入市场管理模块的“售后质量问题处理单页面”进行填写。");
                }
                else
                {
                    Response.Write("<script type='text/javascript'>alert('处理结果填写后您才能分工!!!')</script>");
                    return;
                }
            }
        }
Пример #25
0
        protected void btnLoad_OnClick(object sender, EventArgs e)
        {
            List <string> list_sql = new List <string>();

            if (Request.QueryString["action"] == "review")
            {
                if (firstid.Value == Session["UserID"].ToString() && lbl_state.Text == "1")
                {
                    string sql = "update TBOM_GDZCRVW set CARRVWAADVC='" + first_opinion.Text.ToString() + "',CARRVWATIME='" + first_time.Text.ToString() + "',CARRVWB='" + txt_second.Text.ToString() + "',CARRVWBID='" + secondid.Value.Trim() + "',STATUS='" + rblfirst.SelectedValue.ToString() + "' WHERE CODE='" + lblCode.Text.Trim() + "'";
                    list_sql.Add(sql);
                    DBCallCommon.ExecuteTrans(list_sql);
                    if (rblfirst.SelectedValue.ToString() == "2")
                    {
                        string _emailto = DBCallCommon.GetEmailAddressByUserID(secondid.Value);
                        string _body    = "固定资产采购审批任务:"
                                          + "\r\n单号:" + lblCode.Text.ToString().Trim()
                                          + "\r\n制单日期:" + lblAddtime.Text.ToString().Trim();

                        string _subject = "您有新的【固定资产采购】需要审批,请及时处理:" + lblCode.Text.ToString().Trim();
                        DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
                    }
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('审核成功,提交下一级!');window.location.href='OM_GdzcPcPlan.aspx'", true);
                }
                if (secondid.Value == Session["UserID"].ToString() && lbl_state.Text == "2")
                {
                    string sql = "update TBOM_GDZCRVW set CARRVWBADVC='" + second_opinion.Text.ToString() + "',CARRVWBTIME='" + second_time.Text.ToString() + "',STATUS='" + rblsecond.SelectedValue.ToString() + "' WHERE CODE='" + lblCode.Text.Trim() + "'";
                    list_sql.Add(sql);
                    if (rblsecond.SelectedValue == "4")
                    {
                        sql = "update TBOM_GDZCRVW set STATUS='6' WHERE CODE='" + lblCode.Text.Trim() + "'";
                        list_sql.Add(sql);
                    }
                    DBCallCommon.ExecuteTrans(list_sql);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('审核成功,申请通过!');window.location.href='OM_GdzcPcPlan.aspx'", true);
                }

                //Response.Redirect("OM_GdzcPcPlan.aspx");
            }
        }
Пример #26
0
        protected void btnSubmit_OnClick(object sender, EventArgs e)//********************提交*******************
        {
            string sql = "update EQU_GXHT set HT_SPZT='1' where HT_HTBH='" + txt_HT_HTBH.Text.Trim() + "'";

            try
            {
                DBCallCommon.ExeSqlText(sql);
                string _emailto = DBCallCommon.GetEmailAddressByUserID(hid_HT_SHR1ID.Value);
                string _body    = "设备购销合同审批任务:"
                                  + "\r\n合同编号:" + txt_HT_HTBH.Text.Trim()
                                  + "\r\n制单人:" + lb_HT_ZDR.Text.Trim()
                                  + "\r\n制单日期:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                string _subject = "您有新的【设备购销合同】需要审批,请及时处理:" + txt_HT_HTBH.Text.Trim();
                DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
            }
            catch
            {
                Response.Write("<script>alert('提交审批时数据操作错误,请与管理员联系!')</script>");
                return;
            }
            Response.Redirect("EQU_GXHT_GL.aspx");
        }
Пример #27
0
        protected void btnsubmit_Click(object sender, EventArgs e)
        {
            string        sql1;
            string        sql2;
            List <string> list = new List <string>();

            if (CM_CHECK.SelectedValue != "2")
            {
                sql1 = "update TBCM_CUSTOMER set CM_CHECK='" + CM_CHECK.SelectedValue + "',CM_SFHG='" + CM_CHECK.SelectedValue + "',CM_TEST='" + CM_TEST.SelectedValue + "',CM_RESULT='" + Hid_ZJ.Value + "',CM_ZJDATE='" + CM_ZJDATE.Text + "' where CM_ID='" + Request.QueryString["CM_ID"] + "'";
                list.Add(sql1);
                if (CM_CHECK.SelectedValue == "1")
                {
                    DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(zdr.Value), new List <string>(), new List <string>(), "顾客财产质检通过", "项目为 " + CM_PJNAME.Text + ",入库内容为 " + CM_INCONT.Text + ",已质检通过,请登录系统查看");
                    DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(hdkg.Value), new List <string>(), new List <string>(), "顾客财产质检通过", "项目为 " + CM_PJNAME.Text + ",入库内容为 " + CM_INCONT.Text + ",已质检通过,请登录系统查看");
                    if (psr.Value != "")
                    {
                        string[] strs = psr.Value.Split(',');
                        for (int i = 0; i < strs.Length; i++)
                        {
                            DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(strs[i]), new List <string>(), new List <string>(), "顾客财产质检通过", "项目为 " + CM_PJNAME.Text + ",入库内容为 " + CM_INCONT.Text + ",已质检通过,请登录系统查看");
                        }
                    }
                }
                else if (CM_CHECK.SelectedValue == "0")
                {
                    DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(zdr.Value), new List <string>(), new List <string>(), "顾客财产质检未通过", "项目为 " + CM_PJNAME.Text + ",入库内容为 " + CM_INCONT.Text + ",未通过质检,请登录系统查看");
                }
            }
            if (CM_BTIN.Checked)
            {
                sql2 = "update TBCM_CUSTOMER set CM_BTIN='1',CM_RKYJ='" + CM_RKYJ.Text + "' where CM_ID='" + Request.QueryString["CM_ID"] + "'";
                list.Add(sql2);
                DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(zdr.Value), new List <string>(), new List <string>(), "顾客财产已入库", "项目为 " + CM_PJNAME.Text + ",入库内容为 " + CM_INCONT.Text + ",已入库通过,请登录系统查看");
            }
            DBCallCommon.ExecuteTrans(list);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('信息修改成功!');window.opener=null;window.open('','_self');window.close();", true);
        }
Пример #28
0
 private void SendEmail()
 {
     foreach (ListItem item in cbxCS.Items)
     {
         if (item.Selected)
         {
             DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(item.Value), new List <string>(), new List <string>(), "顾客财产质检", "您有合同号为" + CM_CONTR.Text.Trim() + ",项目名称为" + CM_PJNAME.Text.Trim() + ",顾客为" + CM_COSTERM.Text.Trim() + "的顾客财产需要质检,请登录系统查看。");
         }
     }
     foreach (ListItem item in cbxTH.Items)
     {
         if (item.Selected)
         {
             DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(item.Value), new List <string>(), new List <string>(), "新增顾客财产查看", "合同号为" + CM_CONTR.Text.Trim() + ",项目名称为" + CM_PJNAME.Text.Trim() + ",顾客为" + CM_COSTERM.Text.Trim() + "的顾客财产下推至质检,请登录系统查看。");
         }
     }
     foreach (ListItem item in cbxPD.Items)
     {
         if (item.Selected)
         {
             DBCallCommon.SendEmail(DBCallCommon.GetEmailAddressByUserID(item.Value), new List <string>(), new List <string>(), "新增顾客财产查看", "合同号为" + CM_CONTR.Text.Trim() + ",项目名称为" + CM_PJNAME.Text.Trim() + ",顾客为" + CM_COSTERM.Text.Trim() + "的顾客财产下推至质检,请登录系统查看。");
         }
     }
 }
Пример #29
0
        private List <string> checklist()
        {
            List <string> list = new List <string>();
            string        sql  = string.Format("update OM_SP set SPR1_JL='{0}',SPR1_SJ='{1}',SPR1_JY='{2}',SPR2_JL='{3}',SPR2_SJ='{4}',SPR2_JY='{5}',SPR3_JL='{6}',SPR3_SJ='{7}',SPR3_JY='{8}' where SPFATHERID='{9}'", rblSPR1_JL.SelectedValue, lbSPR1_SJ.Text, txtSPR1_JY.Text.Trim(), rblSPR2_JL.SelectedValue, lbSPR2_SJ.Text, txtSPR2_JY.Text.Trim(), rblSPR3_JL.SelectedValue, lbSPR3_SJ.Text, txtSPR3_JY.Text, id);

            list.Add(sql);
            if (asd.dts.Rows[0]["SPJB"].ToString() == "1")
            {
                if (rblSPR1_JL.SelectedValue == "y")
                {
                    sql = string.Format("update OM_SP set SPZT='y' where SPFATHERID='{0}'", id);
                    list.Add(sql);
                }
            }
            else if (asd.dts.Rows[0]["SPJB"].ToString() == "2")
            {
                if (rblSPR1_JL.SelectedValue == "y")
                {
                    sql = string.Format("update OM_SP set SPZT='1y' where SPFATHERID='{0}'", id);
                    list.Add(sql);
                    if (asd.userid == hidSPR1ID.Value)
                    {
                        string _emailto = DBCallCommon.GetEmailAddressByUserID(hidSPR2ID.Value);
                        string _body    = "固定资产入库审批任务:"
                                          + "\r\n制单人:" + lbl_creater.Text.Trim()
                                          + "\r\n制单日期:" + lblInDate.Text.Trim();

                        string _subject = "您有新的【固定资产入库】需要审批,请及时处理";
                        DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
                    }
                }
                if (rblSPR2_JL.SelectedValue == "y")
                {
                    sql = string.Format("update OM_SP set SPZT='y' where SPFATHERID='{0}'", id);
                    list.Add(sql);
                }
            }
            else if (asd.dts.Rows[0]["SPJB"].ToString() == "3")
            {
                if (rblSPR1_JL.SelectedValue == "y")
                {
                    sql = string.Format("update OM_SP set SPZT='1y' where SPFATHERID='{0}'", id);
                    list.Add(sql);
                    if (asd.userid == hidSPR1ID.Value)
                    {
                        string _emailto = DBCallCommon.GetEmailAddressByUserID(hidSPR2ID.Value);
                        string _body    = "固定资产入库审批任务:"
                                          + "\r\n制单人:" + lbl_creater.Text.Trim()
                                          + "\r\n制单日期:" + lblInDate.Text.Trim();

                        string _subject = "您有新的【固定资产入库】需要审批,请及时处理";
                        DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
                    }
                }
                if (rblSPR2_JL.SelectedValue == "y")
                {
                    sql = string.Format("update OM_SP set SPZT='2y' where SPFATHERID='{0}'", id);
                    list.Add(sql);
                    if (asd.userid == hidSPR2ID.Value)
                    {
                        string _emailto = DBCallCommon.GetEmailAddressByUserID(hidSPR3ID.Value);
                        string _body    = "固定资产入库审批任务:"
                                          + "\r\n制单人:" + lbl_creater.Text.Trim()
                                          + "\r\n制单日期:" + lblInDate.Text.Trim();

                        string _subject = "您有新的【固定资产入库】需要审批,请及时处理";
                        DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
                    }
                }
                if (rblSPR3_JL.SelectedValue == "y")
                {
                    sql = string.Format("update OM_SP set SPZT='y' where SPFATHERID='{0}'", id);
                    list.Add(sql);
                }
            }
            if (rblSPR1_JL.SelectedValue == "n" || rblSPR2_JL.SelectedValue == "n" || rblSPR3_JL.SelectedValue == "n")
            {
                sql = string.Format("update OM_SP set SPZT='n' where SPFATHERID='{0}'", id);
                list.Add(sql);
            }
            return(list);
        }
Пример #30
0
        //审批
        protected void btnAudit_Click(object sender, EventArgs e)
        {
            string sql   = "";
            string state = hidState.Value;
            string level = rblSHJS.SelectedValue;

            if (hidAction.Value == "add" || hidAction.Value == "edit")   //添加和编辑
            {
                sql = "update OM_COMPUTERLIST set state='1' where Context='" + hidConext.Value + "'";
                DBCallCommon.ExeSqlText(sql);
                //邮件提醒
                string _emailto1 = "";
                string _emailto2 = "";
                string _emailto3 = "";

                //不需要进行审核
                if (rblSHJS.SelectedValue == "0")
                {
                    //检索维修类型:网络设备 or 其他
                    foreach (RepeaterItem item in Det_Repeater.Items)
                    {
                        string type = ((DropDownList)item.FindControl("ddlType")).SelectedValue;
                        if (type.Contains("0"))
                        {
                            string    sql1     = "select * from TBDS_STAFFINFO where ST_DEPID='02' and R_NAME like '%信息%' and ST_PD='0'";
                            DataTable sqltable = DBCallCommon.GetDTUsingSqlText(sql1);
                            if (sqltable.Rows.Count > 0)
                            {
                                string id = sqltable.Rows[0]["ST_ID"].ToString();
                                _emailto1 = DBCallCommon.GetEmailAddressByUserID(id);
                            }
                        }
                        else
                        {
                            string    sql1     = "select * from TBDS_STAFFINFO where ST_DEPID='04' and R_NAME like '%设备%' and ST_PD='0'";
                            DataTable sqltable = DBCallCommon.GetDTUsingSqlText(sql1);
                            if (sqltable.Rows.Count > 0)
                            {
                                string id = sqltable.Rows[0]["ST_ID"].ToString();
                                _emailto2 = DBCallCommon.GetEmailAddressByUserID(id);
                            }
                        }
                    }
                    sql = "update OM_COMPUTERLIST set state='3'  where Context='" + hidConext.Value + "'";
                    DBCallCommon.ExeSqlText(sql);
                }
                else
                {
                    _emailto3 = DBCallCommon.GetEmailAddressByUserID(firstid.Value);     //一级审核人
                }
                //发送邮件
                string _body = "办公设备报修审批任务:"
                               + "\r\n制单人:" + lb1.Text.Trim()
                               + "\r\n制单日期:" + txtTime.Text.Trim();

                string _subject = "您有新的【办公设备报修】需要审批,请及时处理";

                if (!String.IsNullOrEmpty(_emailto1))
                {
                    DBCallCommon.SendEmail(_emailto1, null, null, _subject, _body);
                }
                if (!String.IsNullOrEmpty(_emailto2))
                {
                    DBCallCommon.SendEmail(_emailto2, null, null, _subject, _body);
                }
                if (!String.IsNullOrEmpty(_emailto3))
                {
                    DBCallCommon.SendEmail(_emailto3, null, null, _subject, _body);
                }

                Response.Write("<script>alert('保存成功!');window.location.href='OM_ComputerLIst.aspx';</script>");
            }
            else if (action == "audit")
            {
                if (state == "1")
                {
                    if (rblResult1.SelectedIndex == -1)
                    {
                        Response.Write("<script>alert('请选择审核结果!')</script>");
                        return;
                    }
                }
                if (state == "2")
                {
                    if (rblResult2.SelectedIndex == -1)
                    {
                        Response.Write("<script>alert('请选择审核结果!')</script>");
                        return;
                    }
                }
                //0初始化,1审批中,2一级通过,3全部通过,4驳回
                if (level == "1")
                {
                    if (rblResult1.SelectedValue == "0")
                    {
                        state = "3";
                    }
                    else
                    {
                        state = "4";
                    }
                }
                else if (level == "2")
                {
                    if (state == "1")
                    {
                        if (rblResult1.SelectedValue == "0")
                        {
                            state = "2";
                        }
                        else
                        {
                            state = "4";
                        }
                    }
                    else if (state == "2")
                    {
                        if (rblResult2.SelectedValue == "0")
                        {
                            state = "3";
                        }
                        else
                        {
                            state = "4";
                        }
                    }
                }

                sql = "update OM_COMPUTERLIST set state='" + state + "',SPRESULTA='" + rblResult1.SelectedValue + "',SPTIMEA='" + DateTime.Now.ToString() + "',SPNOTEA='" + first_opinion.Text.Trim() + "',SPRESULTB='" + rblResult2.SelectedValue + "',SPTIMEB='" + DateTime.Now.ToString() + "',SPNOTEB='" + second_opinion.Text.Trim() + "'  where Context='" + hidConext.Value + "'";
                DBCallCommon.ExeSqlText(sql);
                //邮件提醒
                string    sqladd = "select state,GZR,SPRIDB from OM_COMPUTERLIST where (state='2'or state='3')and  Context='" + hidConext.Value + "'";
                DataTable dtadd  = DBCallCommon.GetDTUsingSqlText(sqladd);
                if (dtadd.Rows.Count > 0)
                {
                    string id_emailto = "";
                    if (dtadd.Rows[0]["state"].ToString() == "2")
                    {
                        id_emailto = dtadd.Rows[0]["SPRIDB"].ToString();
                    }
                    else
                    {
                        id_emailto = dtadd.Rows[0]["GZR"].ToString();
                    }
                    string _emailto = DBCallCommon.GetEmailAddressByUserID(id_emailto);
                    string _body    = "办公设备报修审批任务:"
                                      + "\r\n制单人:" + lb1.Text.Trim()
                                      + "\r\n制单日期:" + txtTime.Text.Trim();

                    string _subject = "您有新的【办公设备报修】需要审批,请及时处理";
                    if (dtadd.Rows[0]["state"].ToString() == "3")
                    {
                        _subject = "您有新的【办公设备报修】需要确认,请及时处理";
                    }
                    DBCallCommon.SendEmail(_emailto, null, null, _subject, _body);
                }
                Response.Write("<script>alert('保存成功!');window.location.href='OM_ComputerLIst.aspx';</script>");
            }
        }