Beispiel #1
0
        protected void ZButton3_OnClick(object sender, EventArgs e)
        {
            string[] key = PubCom.GetRepeaterKeyList(rplist, "cbselect");
            if (key.Length > 0)
            {
                for (int i = 0; i < key.Length; i++)
                {
                    if (!string.IsNullOrEmpty(key[i]))
                    {
                        int    expertid = Utils.StrToInt(key[i], 0);
                        int    sort     = Utils.StrToInt((rplist.Items[i].FindControl("txtsort") as TextBox).Text, 0);
                        Expert olde     = be.GetExpertsByID(expertid);
                        int    rec      = be.Update(new Expert()
                        {
                            ExpertID = expertid,
                            Istop    = true,
                            Sort     = sort
                        });
                        if (rec != 1)
                        {
                            Message.ShowWrong(this, "设置置顶专家失败!请重试");
                            return;
                        }
                        else
                        {
                            // 插入日志  update

                            Expert        e2  = be.GetExpertsByID(expertid);
                            SysOperateLog log = new SysOperateLog();
                            log.LogID           = StringHelper.getKey();
                            log.LogType         = LogType.专家信息.ToString();
                            log.OperateUser     = GetLogUserName();
                            log.OperateDate     = DateTime.Now;
                            log.LogOperateType  = "专家是否置顶修改";
                            log.LogBeforeObject = JsonHelper.Obj2Json(olde);
                            log.LogAfterObject  = JsonHelper.Obj2Json(e2);
                            bsol.Insert(log);
                        }
                    }
                }

                Message.ShowOKAndReflashOfDelete(this, "设置置顶专家成功!", "zbquery");
            }
        }
Beispiel #2
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            string savepath = DateTime.Now.Year + "_" + DateTime.Now.Month + "/" + DateTime.Now.Day;
            Expert exold    = be.GetExpertsByID(Utils.StrToInt(hfexpertid.Value, 0));
            Expert ex       = new Expert();

            ex.ExpertID = Utils.StrToInt(hfexpertid.Value, 0);
            ex.EName    = PubCom.CheckString(txtEName.Text.Trim());
            ex.ECountry = PubCom.CheckString(txtECountry.Text.Trim());
            ex.ESummary = PubCom.CheckString(txtESummary.Text.Trim());
            if (dpIstop.SelectedValue != "")
            {
                ex.Istop = dpIstop.SelectedValue == "1";
            }
            if (dpEIdentification.SelectedValue != "")
            {
                ex.EIdentification = dpEIdentification.SelectedValue;
            }
            if (be.Update(ex) == 1)
            {
                be.UploadValidate(pic_upload, lbl_pic, PicFilePath, savepath, ex.ExpertID);

                // 插入日志  update

                Expert        exnew = be.GetExpertsByID(Utils.StrToInt(hfexpertid.Value, 0));
                SysOperateLog log   = new SysOperateLog();
                log.LogID           = StringHelper.getKey();
                log.LogType         = LogType.专家信息.ToString();
                log.OperateUser     = GetLogUserName();
                log.OperateDate     = DateTime.Now;
                log.LogOperateType  = "专家修改";
                log.LogBeforeObject = JsonHelper.Obj2Json(exold);
                log.LogAfterObject  = JsonHelper.Obj2Json(exnew);
                bsol.Insert(log);
                Message.ShowOKAndRedirect(this, "修改专家成功", "ExpertManage.aspx");
            }

            else
            {
                Message.ShowWrong(this, "修改专家失败!");
                return;
            }
        }