Exemplo n.º 1
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.messages.checkperson model)
 {
     return(dal.Update(model));
 }
    protected void btnMessages_Click(object sender, EventArgs e)
    {
        RegistrationBusiness Registration = new RegistrationBusiness();

        for (int i = 0; i < this.ReportRepeater.Items.Count; i++)
        {
            CheckBox cb            = (CheckBox)ReportRepeater.Items[i].FindControl("checkbox1");
            Literal  ltPersonID    = (Literal)ReportRepeater.Items[i].FindControl("lblPersonID");
            Literal  ltlblDeptName = (Literal)ReportRepeater.Items[i].FindControl("lblDeptName");
            Literal  ltRegisterNo  = (Literal)ReportRepeater.Items[i].FindControl("lblRegisterNo");
            if (cb.Checked)
            {
                Maticsoft.Model.messages.checkperson en = new Maticsoft.Model.messages.checkperson();

                en = new Maticsoft.BLL.messages.checkperson().GetModel(Convert.ToInt32(ltPersonID.Text));

                if (en != null)
                {
                    //string smsResult = SMS.Send("",en.telephone);

                    Maticsoft.BLL.messages.messages_type   bllType = new Maticsoft.BLL.messages.messages_type();
                    Maticsoft.Model.messages.messages_type msgType = new Maticsoft.Model.messages.messages_type();

                    Maticsoft.Model.messages.messages model = new Maticsoft.Model.messages.messages();

                    model.type     = messagesType.体检过通知.ToString();
                    model.rcvMan   = en.Name;
                    model.rcvTel   = en.Mobile;
                    model.unit     = ltlblDeptName.Text;
                    model.sendTime = DateTime.Now;

                    msgType = bllType.GetModelbyCode(messagesType.体检过通知.GetHashCode().ToString());
                    if (msgType != null)
                    {
                        model.content = msgType.templet;
                    }


                    //model.content = string.Format("[{0}]您好!您在[YYMC]的体检完成,网上www.tophim.com查询体检结果的帐号[ZH]密码[MM]", en.Name);

                    model.status = "成功";

                    Maticsoft.BLL.messages.messages bll = new Maticsoft.BLL.messages.messages();
                    if (bll.Add(model))
                    {
                        Maticsoft.Model.messages.messagesjoin modeljoin = new Maticsoft.Model.messages.messagesjoin();

                        Maticsoft.BLL.messages.messagesjoin blljoin = new Maticsoft.BLL.messages.messagesjoin();

                        if (blljoin.Exists("registration", ltRegisterNo.Text))
                        {
                            string sqlW = string.Format(" jointable='registration' And tableCode='{0}'", en.DeptID.ToString());
                            modeljoin = blljoin.GetModelList(sqlW)[0];

                            modeljoin.messagesid = bll.GetMaxId() - 1;


                            blljoin.Update(modeljoin);
                        }
                        else
                        {
                            modeljoin.jointable  = "registration";
                            modeljoin.tableCode  = ltRegisterNo.Text;
                            modeljoin.messagesid = bll.GetMaxId() - 1;

                            blljoin.Add(modeljoin);
                        }
                    }
                }
            }
        }
        DataBind();
    }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Maticsoft.Model.messages.checkperson model)
 {
     return(dal.Add(model));
 }