Ejemplo n.º 1
0
        protected void btnSaveClose_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["userId"]))
            {
                string       userId = Request.QueryString["userId"];
                Model.tUsers tUsers = BLL.GetModel(Convert.ToInt32(userId));
                if (tUsers == null)
                {
                    return;
                }

                tUsers.usersName   = txtUsername.Text;
                tUsers.trueName    = txtNickName.Text;
                tUsers.roleCode    = Convert.ToInt32(ddlfatherId.SelectedValue);
                tUsers.usersRemark = txtRemark.Text;
                tUsers.dptId       = Convert.ToInt32(dptIdHid.Text);
                tUsers.Address     = txtAdr.Text;
                tUsers.Tel         = txtTel.Text;
                tUsers.Flag        = chkFlag.Checked == true ? 1 : 0;
                if (chk.Checked)
                {
                    if (this.txtPassword.Text.Trim() == "")
                    {
                        Alert.ShowInTop("请输入重置密码!");
                        return;
                    }
                    if (this.txtPassword.Text.Trim() != this.txtPassword2.Text.Trim())
                    {
                        Alert.ShowInTop("两次输入密码不一致!");
                        return;
                    }
                    tUsers.usersPwd = DESEncrypt.Encrypt(this.txtPassword.Text);
                }
                if (BLL.Update(tUsers) == true)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInTop("出错了!");
                }
            }
            else
            {
                Model.tUsers tUsers = new Model.tUsers();

                tUsers.usersName   = txtUsername.Text;
                tUsers.trueName    = txtNickName.Text;
                tUsers.roleCode    = Convert.ToInt32(ddlfatherId.SelectedValue);
                tUsers.usersRemark = txtRemark.Text;
                tUsers.dptId       = Convert.ToInt32(dptIdHid.Text);
                tUsers.Address     = txtAdr.Text;
                tUsers.Tel         = txtTel.Text;
                tUsers.Flag        = chkFlag.Checked == true ? 1 : 0;
                tUsers.usersPwd    = DESEncrypt.Encrypt(this.txtPassword.Text);
                if (BLL.GetList(string.Format(" usersName='{0}'", txtUsername.Text.ToString().Trim())).Tables[0].Rows.Count > 0)
                {
                    Alert.ShowInTop("该用户名已经存在!"); return;
                }
                if (BLL.Add(tUsers) >= 1)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInTop("出错了!");
                }
            }
        }
Ejemplo n.º 2
0
        private void SaveXmxx()
        {
            // 获取指标显示栏目
            //DataRow dr = TU.Globals.FindRow(BLL.Globals.SystemCode.DtJd_zbxsLocal.DefaultView, "Zbbh", this.ddlEjzb.SelectedValue);
            //Model.Dmgl.Jd_zbxs zbxs = TU.ConvertHelper.ConvertToEntity<Model.Dmgl.Jd_zbxs>(dr);

            //bool hasXmmc = !String.IsNullOrEmpty(zbxs.Mcbt); // 需输入名称
            //bool hasJlsl = !String.IsNullOrEmpty(zbxs.Slbt); // 需输入数量
            //bool hasXmrq = !String.IsNullOrEmpty(zbxs.Rqbt); // 需输入日期

            string fzztdm = this.hfdFzztdm.Text;// this.lblDqxn.Text;
            string bmbh   = TStar.Web.Globals.Account.DeptPkid;
            string zbbh   = this.ddlZbbh.SelectedValue;
            string djbh   = this.ddlDjbh.SelectedValue;
            //string ztbh = this.ddlXmzt.SelectedValue;
            //if (this.ddlXmzt.Hidden) ztbh = cbxXmzt.Checked ? this.ddlXmzt.Items[1].Value : "__";
            string fzrbh = this.hfdFzrbh.Text;// TStar.Globals.Account.Pkid;
            //string fzrxm = this.lblFzr.Text;// TStar.Globals.Account.UserName;
            string   xmmc   = TU.Globals.FilterString(this.tbxXmmc.Text);
            DateTime?dtXmrq = this.dtpXmrq.SelectedDate;
            //string jzrq = xmrq;
            //int jlsl = 0;
            //int.TryParse(this.tbxJlsl.Text.Trim(), out jlsl);
            string bz   = TU.Globals.FilterString(this.tbxBz.Text);
            string bcsj = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            //int canExist = 0;
            string errMsg = "";

            if (this.ddlZbbh.SelectedValue == "__")
            {
                errMsg += "请选择项目类别 !\n";
            }
            if (!this.ddlDjbh.Hidden && this.ddlDjbh.SelectedIndex < 1)
            {
                errMsg += "请选择项目等级 !\n";
            }
            if (dtXmrq == null)
            {
                errMsg += "请选择项目日期 !\n";
            }
            else if (dtXmrq < DateTime.Now.AddMonths(-3) || dtXmrq > DateTime.Now)
            {
                errMsg += "请选择近三个月内的日期!\n";
            }
            if (String.IsNullOrEmpty(xmmc))
            {
                errMsg += "请输入项目名称 !\n";
            }
            else if (BLL.Xmgl.Yj_xm.Exist(Pkid, new string[] { "Fzztdm", "Bmbh", "Zbbh", "Fzrbh", "Xmmc" }, new string[] { fzztdm, bmbh, zbbh, fzrbh, xmmc }))
            {
                errMsg += "输入的项目信息已存在 !\n";
            }

            if (errMsg.Length > 0)
            {
                Alert.Show(errMsg, "保存提示", MessageBoxIcon.Warning);
                return;
            }

            Model.Xmgl.Yj_xm xm = new Model.Xmgl.Yj_xm();
            xm.Pkid   = Pkid;
            xm.Fzztdm = fzztdm;
            xm.Bmbh   = bmbh;
            xm.Zbbh   = zbbh;
            xm.Djbh   = djbh == "__" ? null : djbh;
            xm.Fzrbh  = fzrbh;
            xm.Xmmc   = xmmc;
            xm.Xmrq   = xm.Jzrq = dtXmrq.Value.ToString("yyyy-MM-dd");
            xm.Bz     = bz;
            xm.Bcsj   = bcsj;

            try
            {
                BLL.Xmgl.Yj_xm.Save(xm);
                Xmbh = xm.Pkid;
                this.tabStrip1.ActiveTabIndex = 1;

                Alert.Show("项目基本信息保存成功 !", "操作完成", MessageBoxIcon.Information);

                // 修改关闭按钮的客户端脚本
                this.btnClose.OnClientClick = ActiveWindow.GetHidePostBackReference();
            }
            catch (Exception err)
            {
                Alert.Show(err.Message, "保存项目基本信息失败", MessageBoxIcon.Error);
                return;
            }
        }
Ejemplo n.º 3
0
 protected void btn_Cancle_Click(object sender, EventArgs e)
 {
     PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
 }
Ejemplo n.º 4
0
        // 初始化工具栏控件
        // <f:Button runat="server" ID = "btnClose" Icon="SystemClose" EnablePostBack="false" Text="关闭" />
        // <f:Button runat="server" ID = "btnSaveClose" ValidateForms="SimpleForm1" Icon="SystemSaveClose" OnClick="btnSaveClose_Click" Text="保存后关闭" />
        // <f:Button runat="server" ID = "btnSaveNew" ValidateForms="SimpleForm1" Icon="SystemSaveNew" OnClick="btnSaveNew_Click" Text="保存并新增" />
        // <f:ToolbarText runat="server" />
        private void InitToolbar(Toolbar toolbar, bool relayoutToolbar)
        {
            // 信息标签
            lblInfo = new ToolbarText()
            {
                CssStyle = "color:red"
            };

            // 关闭按钮
            btnClose = new Button()
            {
                Icon = Icon.SystemClose, Text = "关闭", EnablePostBack = false
            };
            btnClose.OnClientClick = ActiveWindow.GetHidePostBackReference();

            // 保存并关闭按钮
            btnSaveClose = new Button()
            {
                Icon = Icon.SystemSaveClose, Text = "保存"
            };
            btnSaveClose.ValidateForms = new string[] { this.frm.ID };
            btnSaveClose.Click        += (s, e) =>
            {
                if (Save())
                {
                    ShowInfo("成功保存({0:HH:mm:ss})", DateTime.Now);
                    //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    ShowInfo("保存失败");
                }
            };

            // 保存并新增按钮
            btnSaveNew = new Button()
            {
                Icon = Icon.SystemSaveNew, Text = "保存并新增"
            };
            btnSaveNew.ValidateForms = new string[] { this.frm.ID };
            btnSaveNew.Click        += (s, e) =>
            {
                if (Save())
                {
                    ShowInfo("成功保存({0:HH:mm:ss}),新增中", DateTime.Now);
                    NewData();
                }
                else
                {
                    ShowInfo("保存失败");
                }
            };

            // 添加到工具栏上
            if (relayoutToolbar)
            {
                toolbar.Items.Insert(0, new ToolbarFill());
            }
            toolbar.Items.Insert(0, btnSaveNew);
            toolbar.Items.Insert(0, btnSaveClose);
            toolbar.Items.Insert(0, btnClose);
            toolbar.Items.Add(lblInfo);
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.ServerVariables["HTTP_REFERER"] != null)
                {
                    string url      = Request.ServerVariables["HTTP_REFERER"].Trim();
                    string pageName = SeatManage.SeatManageComm.SeatComm.GetPageName(url);
                    if (pageName != "StudyRoomList.aspx" && pageName != "FormSYS.aspx")
                    {
                        WriteLogs(url);
                        Response.Write("请通过正确方式访问网站!");
                        Response.End();
                        return;
                    }
                }
                else
                {
                    WriteLogs(HttpContext.Current.Request.Url.AbsoluteUri);
                    Response.Write("请通过正确方式访问网站!");
                    Response.End();
                    return;
                }
            }
            if (Request.QueryString["flag"] == "edit")
            {
                if (!IsPostBack)
                {
                    DataBind();
                }
                extform.Hidden    = false;
                remarkform.Hidden = true;
                btnApp.Hidden     = true;
                btnSubmit.Hidden  = false;
            }
            else
            {
                string roomNo = Request.QueryString["roomNo"];
                if (string.IsNullOrEmpty(roomNo))
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    FineUI.Alert.ShowInTop("数据获取失败!");
                }
                else
                {
                    SeatManage.ClassModel.StudyRoomInfo room = SeatManage.Bll.StudyRoomOperation.GetSingleStudyRoonInfo(roomNo);
                    if (room == null)
                    {
                        PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                        FineUI.Alert.ShowInTop("数据获取失败!");
                    }
                    else
                    {
                        if (!IsPostBack)
                        {
                            DateTime nowT = SeatManage.Bll.ServiceDateTime.Now;
                            tpBookingTime.MinTime      = room.Setting.OpenTime;
                            tpBookingTime.MaxTime      = room.Setting.CloseTime;
                            tpBookingTime.SelectedDate = room.Setting.OpenTime;
                            dpBookingDate.MinDate      = nowT;
                            dpBookingDate.SelectedDate = nowT;
                            nbUseTime.MinValue         = 1;
                            string[] cbul = room.Setting.CanUseFacilities.Split(';');
                            if (cbul.Length > 0)
                            {
                                cbUse.Items.Clear();
                                foreach (string item in cbul)
                                {
                                    if (string.IsNullOrEmpty(item))
                                    {
                                        continue;
                                    }
                                    cbUse.Items.Add(new CheckItem(item, item));
                                }
                            }
                            txtFacilitiesRenmark.InnerHtml = room.Setting.FacilitiesRenmark.Replace("\r\n", "<br/>").Replace(" ", "&nbsp;");
                            txtPrecautions.InnerHtml       = room.Setting.Precautions.Replace("\r\n", "<br/>").Replace(" ", "&nbsp;");
                            txtApplicationInfo.InnerHtml   = room.Setting.ApplicationInfo.Replace("\r\n", "<br/>").Replace(" ", "&nbsp;");

                            imgRoomImage.ImageUrl = "~/StudyImage/" + room.RoomImage;
                            string u = Server.UrlEncode(imgRoomImage.ImageUrl);
                            btnImage.OnClientClick = WindowImage.GetShowReference(string.Format("BigImage.aspx?imageurl={0}", u), "大图");
                            extform.Hidden         = true;
                            remarkform.Hidden      = false;
                            btnSubmit.Hidden       = true;
                            btnApp.Hidden          = false;

                            SeatManage.ClassModel.UserInfo user = SeatManage.Bll.Users_ALL.GetUserInfo(this.LoginId);
                            txtApplicantCardNo.Text = this.LoginId;
                            txtApplicantName.Text   = user.UserName;
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
 protected void btnOK_Click(object sender, EventArgs e)
 {
     this.SaveData();
     PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
 }
        /// <summary>
        /// 绑定UI元素
        /// </summary>
        /// <param name="seatNo"></param>
        /// <param name="seatShortNo"></param>GetBespeakLogInfoBySeatNo
        void BindUIElement(string seatNo, string seatShortNo, DateTime date)
        {
            SeatManage.ClassModel.ReadingRoomInfo room           = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(roomNo);
            SeatManage.Bll.T_SM_ReadingRoom       bllReadingRoom = new SeatManage.Bll.T_SM_ReadingRoom();
            foreach (DateTime dt in room.Setting.SeatBespeak.SpecifiedTimeList)
            {
                if (dt <= date)
                {
                    continue;
                }
                DropDownList_Time.Items.Add(new FineUI.ListItem(dt.ToShortTimeString(), dt.ToShortTimeString()));
            }
            DateTime minTime = date.AddMinutes(10 - date.Minute % 10);

            while (true)
            {
                minTime = minTime.AddMinutes(10);
                if (minTime.Date > date.Date)
                {
                    break;
                }
                if (Code.NowReadingRoomState.ReadingRoomOpenState(room.Setting.RoomOpenSet, minTime) == SeatManage.EnumType.ReadingRoomStatus.Close)
                {
                    continue;
                }
                DropDownList_FreeTime.Items.Add(new FineUI.ListItem(minTime.ToShortTimeString(), minTime.ToShortTimeString()));
            }
            if (!room.Setting.SeatBespeak.SpecifiedBespeak)
            {
                rblModel.Hidden = true;
            }
            if (rblModel.SelectedValue == "0")
            {
                DropDownList_FreeTime.Hidden = true;
                DropDownList_Time.Hidden     = true;
            }
            else
            {
                if (!room.Setting.SeatBespeak.SpecifiedTime)
                {
                    DropDownList_Time.Hidden     = true;
                    DropDownList_FreeTime.Hidden = false;
                }
                else
                {
                    DropDownList_FreeTime.Hidden = true;
                    DropDownList_Time.Hidden     = false;
                }
            }
            lblbeginDate.Text     = date.ToShortDateString();
            this.lblSeatNo.Text   = seatShortNo;
            this.lblRoomName.Text = room.Name;
            //判断自己是否已经预约座位
            List <SeatManage.EnumType.BookingStatus> bespeakStatus = new List <SeatManage.EnumType.BookingStatus>();

            bespeakStatus.Add(SeatManage.EnumType.BookingStatus.Waiting);
            List <SeatManage.ClassModel.BespeakLogInfo> readerBespeaklist = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakLogInfoByCardNo(this.LoginId, date);//.GetBespeakList(this.LoginId, null, date, 0, bespeakStatus);

            if (readerBespeaklist.Count > 0)
            {
                FineUI.Alert.ShowInTop("您今天已有预约的座位,请先取消原来的预约。");
                btnBespeak.Enabled = false;
                PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                return;
            }
            //判断可预约次数是否超过
            readerBespeaklist = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakList(this.LoginId, null, date, 0, new List <SeatManage.EnumType.BookingStatus> {
                SeatManage.EnumType.BookingStatus.Confinmed
            });                                                                                                                                                                                          //.GetBespeakList(this.LoginId, null, date, 0, bespeakStatus);
            if (readerBespeaklist.Count >= room.Setting.SeatBespeak.BespeakSeatCount)
            {
                FineUI.Alert.ShowInTop("您一天只能预约" + room.Setting.SeatBespeak.BespeakSeatCount + "次座位。");
                btnBespeak.Enabled = false;
                PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                return;
            }
            //判断读者是否有座位
            if (!room.Setting.SeatBespeak.BespeatWithOnSeat)
            {
                SeatManage.ClassModel.EnterOutLogInfo eol = SeatManage.Bll.T_SM_EnterOutLog.GetEnterOutLogInfoByCardNo(this.LoginId);
                if (eol != null && eol.EnterOutState != SeatManage.EnumType.EnterOutLogType.Leave)
                {
                    FineUI.Alert.ShowInTop("您已有座位,不能再预约座位");
                    btnBespeak.Enabled = false;
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    return;
                }
            }
            //判断操作次数
            if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimesByReadingRoom(this.LoginId, room.Setting.PosTimes, room.No))
            {
                FineUI.Alert.ShowInTop("您的选座/预约操作过于频繁,请稍后重试");
                btnBespeak.Enabled = false;
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                return;
            }
            //判断座位是否被别人使用
            SeatManage.ClassModel.Seat seat = SeatManage.Bll.T_SM_Seat.GetSeatInfoBySeatNo(seatNo);
            if (seat.SeatUsedState != SeatManage.EnumType.EnterOutLogType.Leave)
            {
                FineUI.Alert.ShowInTop("座位已经被别人选择,请预约其他座位");
                btnBespeak.Enabled = false;
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                return;
            }
            //判断座位是否被预约
            List <SeatManage.ClassModel.BespeakLogInfo> list = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakLogInfoBySeatNo(seatNo, date);

            seatKeepTime.Value   = room.Setting.SeatBespeak.SeatKeepTime.ToString();
            this.lblEndDate.Text = string.Format("{0}至{1}", date.ToShortTimeString(), date.AddMinutes(room.Setting.SeatBespeak.SeatKeepTime).ToShortTimeString());
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].BsepeakState == SeatManage.EnumType.BookingStatus.Waiting)
                {
                    FineUI.Alert.ShowInTop("座位已经被别人预约,请预约其他座位");
                    btnBespeak.Enabled = false;
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    return;
                }
            }
            //判断是否已加入黑名单
            List <SeatManage.ClassModel.BlackListInfo> blacklistInfoByCardNo = SeatManage.Bll.T_SM_Blacklist.GetBlackListInfo(this.LoginId);

            SeatManage.ClassModel.RegulationRulesSetting rulesSet = SeatManage.Bll.T_SM_SystemSet.GetRegulationRulesSetting();
            if (room.Setting.UsedBlacklistLimit && blacklistInfoByCardNo.Count > 0)
            {
                if (room.Setting.BlackListSetting.Used)
                {
                    bool isblack = false;
                    foreach (SeatManage.ClassModel.BlackListInfo blinfo in blacklistInfoByCardNo)
                    {
                        if (blinfo.ReadingRoomID == room.No)
                        {
                            isblack = true;
                            break;
                        }
                    }
                    if (isblack)
                    {
                        FineUI.Alert.ShowInTop("你已进入黑名单,不能在该阅览室预约座位");
                        PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                        return;
                    }
                }
                else
                {
                    FineUI.Alert.ShowInTop("你已进入黑名单,不能在该阅览室预约座位");
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                    return;
                }
            }
            if (room.Setting.LimitReaderEnter.Used)
            {
                SeatManage.ClassModel.ReaderInfo readerInfo = SeatManage.Bll.EnterOutOperate.GetReaderInfo(this.LoginId);
                string[] litype = room.Setting.LimitReaderEnter.ReaderTypes.Split(';');
                if (!room.Setting.LimitReaderEnter.CanEnter)
                {
                    foreach (string type in litype)
                    {
                        if (type == readerInfo.ReaderType)
                        {
                            FineUI.Alert.ShowInTop("你的读者类型不能在该阅览室预约座位");
                            PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                            return;
                        }
                    }
                }
                else
                {
                    bool isintype = false;
                    foreach (string type in litype)
                    {
                        if (type == readerInfo.ReaderType)
                        {
                            isintype = true;
                            break;
                        }
                    }
                    if (!isintype)
                    {
                        FineUI.Alert.ShowInTop("你的读者类型不能在该阅览室预约座位");
                        PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                        return;
                    }
                }
            }

            btnBespeak.Enabled = true;
        }
Ejemplo n.º 8
0
        public ActionResult btnEdit_Click([Bind(Include = "record_id,record_aj_no,record_jj_no,record_ky_no,bg_unit,ky_unit,ky_date,af_time,bj_time,bjr,bjr_sex," +
                                                          "bjr_idcard,bjr_phoneNo,kyks_time,kyjs_time,dest_unit,xz,fs_loc,xc_loc,xc_locpt,weather_info,trend_info,temper_info," +
                                                          "humidity_info,light_info,bh_flag,bhr_name,bhr_unit_name,bhr_pos,bh_function,xc_info,bd_reason,jzr,jzr_sex,jzr_birth,jzr_address,zhr_name,zhr_unit_name,zhr_pos,bhr_name,blr_name,ztr_name,zxr_name,lxr_name,lyr_name,xc_disp,record_reason")] pbs_record record)
        {
            if (ModelState.IsValid)
            {
                record.record_title = record.fs_loc + record.xc_loc + "-" + record.xz;

                //UIHelper.HtmlEditor("HtmlEditor1");
                db.pbs_record.Attach(record);
                var stateEntity = ((IObjectContextAdapter)db).ObjectContext.ObjectStateManager.GetObjectStateEntry(record);
                stateEntity.SetModifiedProperty("record_title");
                stateEntity.SetModifiedProperty("record_aj_no");
                stateEntity.SetModifiedProperty("record_jj_no");
                stateEntity.SetModifiedProperty("record_ky_no");
                stateEntity.SetModifiedProperty("af_time");
                stateEntity.SetModifiedProperty("bg_unit");
                stateEntity.SetModifiedProperty("ky_unit");
                stateEntity.SetModifiedProperty("ky_date");
                stateEntity.SetModifiedProperty("bj_time");
                stateEntity.SetModifiedProperty("bjr");
                stateEntity.SetModifiedProperty("bjr_sex");
                stateEntity.SetModifiedProperty("bjr_idcard");
                stateEntity.SetModifiedProperty("bjr_phoneNo");
                stateEntity.SetModifiedProperty("kyks_time");
                stateEntity.SetModifiedProperty("kyjs_time");
                stateEntity.SetModifiedProperty("dest_unit");
                stateEntity.SetModifiedProperty("xz");
                stateEntity.SetModifiedProperty("fs_loc");
                stateEntity.SetModifiedProperty("xc_loc");
                stateEntity.SetModifiedProperty("xc_locpt");
                stateEntity.SetModifiedProperty("weather_info");
                stateEntity.SetModifiedProperty("trend_info");
                stateEntity.SetModifiedProperty("temper_info");
                stateEntity.SetModifiedProperty("humidity_info");
                stateEntity.SetModifiedProperty("light_info");
                stateEntity.SetModifiedProperty("bh_flag");
                stateEntity.SetModifiedProperty("bhr_name");
                stateEntity.SetModifiedProperty("bhr_unit_name");
                stateEntity.SetModifiedProperty("bhr_pos");
                stateEntity.SetModifiedProperty("bh_function");
                stateEntity.SetModifiedProperty("xc_info");
                stateEntity.SetModifiedProperty("bd_reason");
                stateEntity.SetModifiedProperty("jzr");
                stateEntity.SetModifiedProperty("jzr_sex");
                stateEntity.SetModifiedProperty("jzr_birth");
                stateEntity.SetModifiedProperty("jzr_address");
                stateEntity.SetModifiedProperty("zhr_name");
                stateEntity.SetModifiedProperty("zhr_unit_name");
                stateEntity.SetModifiedProperty("zhr_pos");
                stateEntity.SetModifiedProperty("blr_name");
                stateEntity.SetModifiedProperty("ztr_name");
                stateEntity.SetModifiedProperty("zxr_name");
                stateEntity.SetModifiedProperty("lxr_name");
                stateEntity.SetModifiedProperty("lyr_name");
                stateEntity.SetModifiedProperty("xc_disp");
                stateEntity.SetModifiedProperty("record_reason");
                db.SaveChanges();

                // 关闭本窗体(触发窗体的关闭事件)
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }

            return(UIHelper.Result());
        }
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            OperationResult             objOperationResult    = new OperationResult();
            List <ServiceComponentList> lServiceComponentList = new List <ServiceComponentList>();
            ServiceBL     _ObjServiceBL = new ServiceBL();
            CheckBoxField field1        = (CheckBoxField)grdData.FindColumn("CheckBoxField2");

            for (int i = 0; i < grdData.Rows.Count; i++)
            {
                servicecomponentDto objServiceComponentDto = new servicecomponentDto();

                bool ChecAdicional = field1.GetCheckedState(i);
                var  Flag          = grdData.Rows[i].Values[4].ToString();

                if (ChecAdicional)
                {
                    objServiceComponentDto.v_ServiceId              = Session["SerId"].ToString();
                    objServiceComponentDto.i_ExternalInternalId     = 1;//interno
                    objServiceComponentDto.i_ServiceComponentTypeId = 1;
                    objServiceComponentDto.i_IsVisibleId            = 1;
                    objServiceComponentDto.i_IsInheritedId          = 0;
                    objServiceComponentDto.d_StartDate              = null;
                    objServiceComponentDto.d_EndDate                  = null;
                    objServiceComponentDto.i_index                    = 1;
                    objServiceComponentDto.r_Price                    = 10;
                    objServiceComponentDto.v_ComponentId              = grdData.Rows[i].Values[3];
                    objServiceComponentDto.i_IsInvoicedId             = 0;
                    objServiceComponentDto.i_ServiceComponentStatusId = 1; // (int)Common.ServiceStatus.PorIniciar;
                    objServiceComponentDto.i_QueueStatusId            = 1; // (int)Common.QueueStatusId.LIBRE;
                    objServiceComponentDto.i_Iscalling                = 0; // (int)Common.Flag_Call.NoseLlamo;
                    objServiceComponentDto.i_IsManuallyAddedId        = 0; // (int)Common.SiNo.NO;
                    objServiceComponentDto.i_IsRequiredId             = 1; // (int)Common.SiNo.SI;
                    if (Flag == "0")
                    {
                        _ObjServiceBL.AddServiceComponent(ref objOperationResult, objServiceComponentDto, ((ClientSession)Session["objClientSession"]).GetAsList());
                    }
                    else if (Flag == "1")
                    {
                        _ObjServiceBL.UpdateAdditionalExam(ref objOperationResult, grdData.Rows[i].Values[5].ToString(), 1, ((ClientSession)Session["objClientSession"]).GetAsList());
                    }
                }
                else if (ChecAdicional == false)
                {
                    //var Lista_OLD = (List<Categoria>)Session["lComponentes_OLD"];

                    //var Flag =   grdData.Rows[i].Values[4].ToString();
                    if (Flag == "1")
                    {
                        _ObjServiceBL.UpdateAdditionalExam(ref objOperationResult, grdData.Rows[i].Values[5].ToString(), 0, ((ClientSession)Session["objClientSession"]).GetAsList());
                    }
                    //Lista_OLD.Find(p => p.v_ComponentId == grdData.Rows[i].Values[3].ToString());
                }
            }

            //Analizar el resultado de la operación
            if (objOperationResult.Success == 1)  // Operación sin error
            {
                // Cerrar página actual y hacer postback en el padre para actualizar
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else  // Operación con error
            {
                Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult.ExceptionMessage);
                // Se queda en el formulario.
            }
        }
Ejemplo n.º 10
0
 private void LoadData()
 {
     btnClose.OnClientClick = ActiveWindow.GetHidePostBackReference();
 }
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();
            ServiceBL       oServiceBL         = new ServiceBL();
            List <Sigesoft.Node.WinClient.BE.RecomendationList>        Recomendaciones            = new List <Node.WinClient.BE.RecomendationList>();
            List <Sigesoft.Node.WinClient.BE.DiagnosticRepositoryList> _ListadiagnosticRepository = new List <Sigesoft.Node.WinClient.BE.DiagnosticRepositoryList>();

            Sigesoft.Node.WinClient.BE.RecomendationList        Recomendacion        = null;
            Sigesoft.Node.WinClient.BE.DiagnosticRepositoryList diagnosticRepository = new Sigesoft.Node.WinClient.BE.DiagnosticRepositoryList();

            string Mode = Request.QueryString["Mode"].ToString();

            if (Mode == "New")
            {
                //Verificar si el hábito ya existe en la grilla
                var Result = _objHistoryBL.ListarGrillaNocivos(Session["PersonId"].ToString()).Find(p => p.i_TypeHabitsId == int.Parse(ddlTipoHabito.SelectedValue.ToString()));

                if (Result != null)
                {
                    Alert.ShowInTop("Este hábito nocivo ya se encuentra registrado, revíselo y edítelo.");
                    return;
                }
                noxioushabitsDto onoxioushabitsDto = new noxioushabitsDto();
                onoxioushabitsDto.i_TypeHabitsId = int.Parse(ddlTipoHabito.SelectedValue.ToString());
                onoxioushabitsDto.v_Frequency    = ddlFrecuencia.SelectedText.ToString();
                onoxioushabitsDto.v_PersonId     = Session["PersonId"].ToString();
                onoxioushabitsDto.v_Comment      = txtComentario.Text;

                _objHistoryBL.AddNocivo(ref objOperationResult, onoxioushabitsDto, ((ClientSession)Session["objClientSession"]).GetAsList());

                if (ddlFrecuencia.SelectedText.ToString() == "FUMADOR")
                {
                    diagnosticRepository.v_DiagnosticRepositoryId = Guid.NewGuid().ToString();
                    diagnosticRepository.v_DiseasesId             = "N009-DD000000519";
                    diagnosticRepository.i_AutoManualId           = 1;
                    diagnosticRepository.i_PreQualificationId     = 1;
                    diagnosticRepository.i_FinalQualificationId   = (int)FinalQualification.Definitivo;
                    diagnosticRepository.i_DiagnosticTypeId       = (int)TipoDx.Enfermedad_Comun;

                    diagnosticRepository.v_ServiceId    = Session["ServiceId"].ToString();
                    diagnosticRepository.v_ComponentId  = "N002-ME000000022"; //_componentId;
                    diagnosticRepository.i_RecordStatus = (int)RecordStatus.Agregado;
                    diagnosticRepository.i_RecordType   = (int)RecordType.Temporal;

                    var ListaReco = oServiceBL.ObtenerListaRecomendacionesPorDxFrecuente("N002-HG000000229", 1);

                    foreach (var item in ListaReco)
                    {
                        Recomendacion = new Node.WinClient.BE.RecomendationList();

                        Recomendacion.v_ServiceId              = Session["ServiceId"].ToString();
                        Recomendacion.v_ComponentId            = "N002-ME000000022";
                        Recomendacion.v_MasterRecommendationId = item.v_MasterRecommendationRestricctionId;
                        Recomendacion.i_RecordType             = (int)RecordType.Temporal;
                        Recomendacion.i_RecordStatus           = (int)RecordStatus.Agregado;
                        Recomendaciones.Add(Recomendacion);
                    }

                    diagnosticRepository.Recomendations = Recomendaciones;
                    _ListadiagnosticRepository.Add(diagnosticRepository);
                    oServiceBL.AddDiagnosticRepository(ref objOperationResult, _ListadiagnosticRepository, null, ((ClientSession)Session["objClientSession"]).GetAsList(), true);
                }
            }
            else if (Mode == "Edit")
            {
                noxioushabitsDto onoxioushabitsDto = (noxioushabitsDto)Session["objEntity"];

                onoxioushabitsDto.i_TypeHabitsId = int.Parse(ddlTipoHabito.SelectedValue.ToString());
                onoxioushabitsDto.v_Frequency    = ddlFrecuencia.SelectedText.ToString();
                onoxioushabitsDto.v_Comment      = txtComentario.Text;

                _objHistoryBL.UpdateNocivo(ref objOperationResult, onoxioushabitsDto, ((ClientSession)Session["objClientSession"]).GetAsList());

                if (ddlFrecuencia.SelectedText.ToString() == "FUMADOR")
                {
                    diagnosticRepository.v_DiagnosticRepositoryId = Guid.NewGuid().ToString();
                    diagnosticRepository.v_DiseasesId             = "N009-DD000000519";
                    diagnosticRepository.i_AutoManualId           = 1;
                    diagnosticRepository.i_PreQualificationId     = 1;
                    diagnosticRepository.i_FinalQualificationId   = (int)FinalQualification.Definitivo;
                    diagnosticRepository.i_DiagnosticTypeId       = (int)TipoDx.Enfermedad_Comun;

                    diagnosticRepository.v_ServiceId    = Session["ServiceId"].ToString();
                    diagnosticRepository.v_ComponentId  = "N002-ME000000022"; //_componentId;
                    diagnosticRepository.i_RecordStatus = (int)RecordStatus.Agregado;
                    diagnosticRepository.i_RecordType   = (int)RecordType.Temporal;

                    var ListaReco = oServiceBL.ObtenerListaRecomendacionesPorDxFrecuente("N002-HG000000229", 1);

                    foreach (var item in ListaReco)
                    {
                        Recomendacion = new Node.WinClient.BE.RecomendationList();

                        Recomendacion.v_ServiceId              = Session["ServiceId"].ToString();
                        Recomendacion.v_ComponentId            = "N002-ME000000022";
                        Recomendacion.v_MasterRecommendationId = item.v_MasterRecommendationRestricctionId;
                        Recomendacion.i_RecordType             = (int)RecordType.Temporal;
                        Recomendacion.i_RecordStatus           = (int)RecordStatus.Agregado;
                        Recomendaciones.Add(Recomendacion);
                    }

                    diagnosticRepository.Recomendations = Recomendaciones;
                    _ListadiagnosticRepository.Add(diagnosticRepository);
                    oServiceBL.AddDiagnosticRepository(ref objOperationResult, _ListadiagnosticRepository, null, ((ClientSession)Session["objClientSession"]).GetAsList(), true);
                }
            }
            //Analizar el resultado de la operación
            if (objOperationResult.Success == 1)  // Operación sin error
            {
                // Cerrar página actual y hacer postback en el padre para actualizar
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else  // Operación con error
            {
                Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult.ExceptionMessage);
                // Se queda en el formulario.
            }
        }
Ejemplo n.º 12
0
        private void SaveData(bool isClose)
        {
            //新增权限
            if (!VerifyPurview(",SM-ADD,"))
            {
                Alert.ShowInParent(CHECK_POWER_FAIL_ACTION_MESSAGE);
                return;
            }
            string strErr = String.Empty;
            int    num = 1, parentId = 0;
            string name = HttpUtility.HtmlEncode(txtName.Text.Trim());

            if (name.Length == 0)
            {
                strErr += num + "、请输入菜单名称 <br />";
                num++;
            }
            string code = HttpUtility.HtmlEncode(txtCode.Text.Trim());

            if (code.Length == 0)
            {
                strErr += num + "、请输入菜单权益编码 <br />";
                num++;
            }
            if (!Int32.TryParse(ddlParentId.SelectedValue, out parentId) || parentId < 0)
            {
                strErr += num + "、请选择所属菜单 <br />";
            }
            if (strErr.Length > 0)
            {
                Alert.ShowInParent(strErr);
                return;
            }
            ModModel model = new ModModel();

            model.Name     = name;
            model.ParentId = parentId;
            model.Code     = code;
            model.Disabled = chkDisabled.Checked;
            model.Link     = HttpUtility.HtmlEncode(txtLinkUrl.Text.Trim());
            model.Icon     = HttpUtility.HtmlEncode(txtIcon.Text.Trim());
            int result = new ModBLL().Add(model);

            if (result > 0)
            {
                if (isClose)
                {
                    Alert.ShowInParent("保存成功!", String.Empty, ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInParent("保存成功!");
                    PageContext.Refresh();
                }
            }
            else if (result == -10000)
            {
                Alert.ShowInParent("同级菜单已存在该名称数据");
            }
            else
            {
                Alert.ShowInParent("保存失败");
            }
        }
Ejemplo n.º 13
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //保存权限
            if (!VerifyPurview(",SU-EDIT,"))
            {
                Alert.ShowInParent(CHECK_POWER_FAIL_ACTION_MESSAGE);
                return;
            }
            string strErr = String.Empty;
            int    num    = 1;

            if (id <= 0)
            {
                strErr += num + "、参数错误 <br />";
                num++;
            }
            string vName = HttpUtility.HtmlEncode(txtVerityName.Text.Trim());

            if (vName.Length == 0)
            {
                strErr += num + "、真实姓名不能为空 <br />";
            }
            if (strErr.Length > 0)
            {
                Alert.ShowInParent(strErr);
                return;
            }
            UserModel model = new UserModel();

            model.Id = id;
            string pwd = HttpUtility.HtmlEncode(txtPwd.Text.Trim());

            if (pwd.Length > 0)
            {
                model.Encrypt = RandomHelper.CreateRandomStr(6);
                model.Pwd     = MD5Encrypt.GetPass(pwd, model.Encrypt);
            }
            model.RealName = vName;
            model.Email    = HttpUtility.HtmlEncode(txtEmail.Text.Trim());
            model.Mobile   = HttpUtility.HtmlEncode(txtMobile.Text.Trim());
            model.Tel      = HttpUtility.HtmlEncode(txtTel.Text.Trim());
            model.Disabled = chkDisabled.Checked;
            int     result = 0;
            UserBLL bll    = new UserBLL();

            using (DataTable roleDT = new DataTable())
            {
                roleDT.Columns.Add("roleid", typeof(int));
                roleDT.Columns.Add("userid", typeof(int));
                #region 角色用户
                string userRole = hfSelectedRole.Text.Trim();
                if (userRole.Length > 0)
                {
                    string[] userRoleArr = userRole.Split(',');
                    foreach (string s in userRoleArr)
                    {
                        DataRow dr = roleDT.NewRow();
                        dr[0] = Convert.ToInt32(s);
                        dr[1] = model.Id;
                        roleDT.Rows.Add(dr);
                    }
                }
                #endregion
                result = bll.Modify(model, roleDT);
            }
            if (result > 0)
            {
                Alert.ShowInParent("保存成功!", String.Empty, ActiveWindow.GetHidePostBackReference());
            }
            else
            {
                Alert.ShowInParent("保存失败");
            }
        }
Ejemplo n.º 14
0
        //提交按钮点击事件
        protected void btnSubmit_OnClick(object sender, EventArgs e)
        {
            string flag     = Request.QueryString["flag"];
            string modSeq   = "";
            string menuName = txtMenuName.Text;
            int    index    = Convert.ToInt32(NumberBoxSort.Text);
            string mainNum  = "";
            int    menuLv   = 0;

            if (ddlMenuLv.SelectedValue == "first")
            {
                mainNum = txtMenuNum.Text;
                menuLv  = 1;
                modSeq  = "0000";
            }
            else
            {
                mainNum = ddlMainNum.SelectedValue;
                menuLv  = 2;
                modSeq  = ddlFunciPage.SelectedValue;
            }
            SeatManage.ClassModel.SysMenuInfo modelSysMenu = new SeatManage.ClassModel.SysMenuInfo();
            modelSysMenu.MainNum     = mainNum;
            modelSysMenu.MenuName    = menuName;
            modelSysMenu.MenuLv      = menuLv;
            modelSysMenu.Index       = index;
            modelSysMenu.FuncPageNum = modSeq;
            switch (flag)
            {
            //新增菜单
            case "add":
                if (SeatManage.Bll.SysMenu.AddMenus(modelSysMenu))
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    FineUI.Alert.ShowInTop("添加成功!");
                }
                else
                {
                    FineUI.Alert.ShowInTop("添加失败!");
                }
                break;

            //修改菜单
            case "edit":
                modelSysMenu.ImageUrl = DBNull.Value.ToString();
                modelSysMenu.MenuID   = Convert.ToInt32(Request.QueryString["MenuID"]);
                if (SeatManage.Bll.SysMenu.UpdateMenus(modelSysMenu))
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    FineUI.Alert.ShowInTop("修改成功!");
                }
                else
                {
                    FineUI.Alert.ShowInTop("修改失败!");
                }
                break;

            default:
                FineUI.Alert.ShowInTop("未执行任何操作");
                break;
            }
        }
Ejemplo n.º 15
0
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            string          Mode = Request.QueryString["Mode"].ToString();
            OperationResult objOperationResult = new OperationResult();

            if (Mode == "New")
            {
                // Create the entity
                datahierarchyDto objEntity = new datahierarchyDto();

                // Populate the entity
                objEntity.i_GroupId      = int.Parse(txtGroupId.Text.Trim());
                objEntity.i_ItemId       = int.Parse(txtParameterId.Text.Trim());
                objEntity.v_Value1       = txtDescription.Text.Trim().ToUpper();
                objEntity.v_Value2       = txtDescription2.Text.Trim().ToUpper();
                objEntity.v_Field        = txtField.Text.Trim().ToUpper();
                objEntity.i_ParentItemId = -1;

                // Obtener el usuario autenticado
                int intUserPersonId = ((ClientSession)Session["objClientSession"]).i_SystemUserId;
                //Validar si la Clave primaria ya existe.
                if (_objBL.GetDataHierarchy(ref objOperationResult, objEntity.i_GroupId, objEntity.i_ItemId) != null)
                {
                    Alert.Show("La clave primaria ya existe!", MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    // Save the data
                    _objBL.AddDataHierarchy(ref objOperationResult, objEntity, ((ClientSession)Session["objClientSession"]).GetAsList());
                }
            }
            else if (Mode == "Edit")
            {
                // Obtener el usuario autenticado
                int intUserPersonId = ((ClientSession)Session["objClientSession"]).i_SystemUserId;

                // Get the entity from the session
                datahierarchyDto objEntity = (datahierarchyDto)Session["objEntity"];

                // Populate the entity
                objEntity.i_GroupId = int.Parse(txtGroupId.Text.Trim());
                objEntity.i_ItemId  = int.Parse(txtParameterId.Text.Trim());
                objEntity.v_Value1  = txtDescription.Text.Trim().ToUpper();
                if (txtUserInterfaceOrder.Text == "")
                {
                    objEntity.i_Sort = null;
                }
                else
                {
                    objEntity.i_Sort = int.Parse(txtUserInterfaceOrder.Text.Trim());
                }
                objEntity.v_Value2       = txtDescription2.Text.Trim().ToUpper();
                objEntity.v_Field        = txtField.Text.Trim().ToUpper();
                objEntity.i_ParentItemId = Int32.Parse(ddlParentItemId.SelectedValue);

                // Save the data
                _objBL.UpdateDataHierarchy(ref objOperationResult, objEntity, ((ClientSession)Session["objClientSession"]).GetAsList());
            }
            else if (Mode == "NewChildren")
            {
                // Obtener el usuario autenticado
                //int intUserPersonId = ((ClientSession)Session["objClientSession"]).i_SystemUserId;

                // Create the entity
                datahierarchyDto objEntity = new datahierarchyDto();

                // Populate the entity
                objEntity.i_GroupId = int.Parse(txtGroupId.Text.Trim());
                objEntity.i_ItemId  = int.Parse(txtParameterId.Text.Trim());
                objEntity.v_Value1  = txtDescription.Text.Trim().ToUpper();
                if (txtUserInterfaceOrder.Text == "")
                {
                    objEntity.i_Sort = null;
                }
                else
                {
                    objEntity.i_Sort = int.Parse(txtUserInterfaceOrder.Text.Trim());
                }
                objEntity.v_Value2       = txtDescription2.Text.Trim().ToUpper();
                objEntity.v_Field        = txtField.Text.Trim().ToUpper();
                objEntity.i_ParentItemId = Int32.Parse(ddlParentItemId.SelectedValue);

                if (_objBL.GetDataHierarchy(ref objOperationResult, objEntity.i_GroupId, objEntity.i_ItemId) != null)
                {
                    Alert.Show("¡La clave primaria ya existe!", MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    // Save the data
                    _objBL.AddDataHierarchy(ref objOperationResult, objEntity, ((ClientSession)Session["objClientSession"]).GetAsList());
                }
            }
            //Analizar el resultado de la operación
            if (objOperationResult.Success == 1)  // Operación sin error
            {
                // Cerrar página actual y hacer postback en el padre para actualizar
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else  // Operación con error
            {
                Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult.ExceptionMessage);
                // Se queda en el formulario.
            }
        }
Ejemplo n.º 16
0
 protected void Window_Close(object sender, WindowCloseEventArgs e)
 {
     PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
 }
Ejemplo n.º 17
0
        protected void Page_Init(object sender, EventArgs e)
        {
            if (Request.QueryString["WhichPage"].ToString() == "ExeCheck")
            {
                List <AnswerTitle> ListAnswerTitle = Session["ExeCheckTitleClassList"] as List <AnswerTitle>;
                if (ListAnswerTitle.Count > 0)
                {
                    if (Convert.ToInt32(Session["TitleIndex"]) == 0)
                    {
                        btn_LastTitle.Enabled = false;
                    }
                    if (Convert.ToInt32(Session["TitleIndex"]) < ListAnswerTitle.Count)
                    {
                        //OnQueryAnswerByTitleID(null, answerArgs);
                        txtCheckTitleName.Text     = ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].TitleName;
                        areaCheckTitleContent.Text = ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].TitleContent;
                        DataTable dtAnswer = new DataTable();
                        int       a        = Convert.ToInt32(Session["TitleIndex"]);
                        if (ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].CheckedId == 0)
                        {
                            answerArgs.CheckTitleID = ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].TitleID;
                            CJia.HealthInspection.Models.AnswerModel answerModel = new Models.AnswerModel();
                            dtAnswer = answerModel.QuyerAnswerByTitleID(answerArgs.CheckTitleID);
                            if (dtAnswer != null && dtAnswer.Rows != null && dtAnswer.Rows.Count > 0)
                            {
                                ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].dtAnswer = dtAnswer;
                                ExtAspNet.RadioButtonList radioAnswer = new ExtAspNet.RadioButtonList();
                                radioAnswer.ID                    = "radioAnswer1";
                                radioAnswer.AutoPostBack          = true;
                                radioAnswer.Required              = true;
                                radioAnswer.SelectedIndexChanged += new EventHandler(radioAnswer_SelectedIndexChanged);
                                radioAnswer.Label                 = "选择答案";
                                for (int i = 0; i < dtAnswer.Rows.Count; i++)
                                {
                                    radioAnswer.Items.Add(new RadioItem(dtAnswer.Rows[i]["ANSWER_NAME"].ToString(), dtAnswer.Rows[i]["ANSWER_ID"].ToString()));
                                }
                                //radioAnswer.DataTextField = "ANSWER_NAME";
                                //radioAnswer.DataValueField = "ANSWER_ID";
                                //radioAnswer.DataSource = dtAnswer;
                                //radioAnswer.DataBind();
                                radioRow.Items.Add(radioAnswer);
                                Session["RadioButtonList"] = radioAnswer;
                                texCheckRusult.Readonly    = true;
                                txtCheckAdvice.Readonly    = true;
                            }
                            else
                            {
                                texCheckRusult.Readonly = false;
                                txtCheckAdvice.Readonly = false;
                                //texCheckRusult.Height = 116;
                                //txtCheckAdvice.Height = 116;
                                texCheckRusult.Text = ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].TitleRusult;
                                txtCheckAdvice.Text = ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].TitleAdvice;
                                //ExtAspNet.Alert.Show("此题没有答案");
                            }
                        }
                        else
                        {
                            dtAnswer = ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].dtAnswer;
                            if (dtAnswer != null && dtAnswer.Rows != null && dtAnswer.Rows.Count > 0)
                            {
                                ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].dtAnswer = dtAnswer;
                                ExtAspNet.RadioButtonList radioAnswer = new ExtAspNet.RadioButtonList();
                                radioAnswer.ID                    = "radioAnswer1";
                                radioAnswer.AutoPostBack          = true;
                                radioAnswer.Required              = true;
                                radioAnswer.SelectedIndexChanged += new EventHandler(radioAnswer_SelectedIndexChanged);
                                radioAnswer.Label                 = "选择答案";
                                for (int i = 0; i < dtAnswer.Rows.Count; i++)
                                {
                                    radioAnswer.Items.Add(new RadioItem(dtAnswer.Rows[i]["ANSWER_NAME"].ToString(), dtAnswer.Rows[i]["ANSWER_ID"].ToString()));
                                }
                                radioAnswer.Items[ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].CheckedIndex].Selected = true;
                                texCheckRusult.Text = ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].TitleRusult;
                                txtCheckAdvice.Text = ListAnswerTitle[Convert.ToInt32(Session["TitleIndex"])].TitleAdvice;
                                radioRow.Items.Add(radioAnswer);
                                Session["RadioButtonList"] = radioAnswer;
                                texCheckRusult.Readonly    = true;
                                txtCheckAdvice.Readonly    = true;
                            }
                            //else
                            //{
                            //    ExtAspNet.Alert.Show("此题没有答案");
                            //}
                        }
                        Session["IsAnswer"] = "1";
                    }
                    else
                    {
                        //Session["ExeCheckTitleClassList"] = ListAnswerTitle;
                        //if (Session["ExeCheckTitleClassList"] != null)
                        //{
                        //    string CheckResult = "XX市XX区卫生监督所卫生监督员【{0},{1}】,对【{2}】进行现场检查。检查人员向【{3}】负责人出示执法证并了解相关情况,经检查发现:" + Environment.NewLine; ;
                        //    string CheckAdvice = "";
                        //    int a = 1;
                        //    int b = 1;
                        //    //List<AnswerTitle> ListAnswerTitle1 = Session["ExeCheckTitleClassList"] as List<AnswerTitle>;
                        //    for (int i = 0; i < ListAnswerTitle.Count; i++)
                        //    {
                        //        if (ListAnswerTitle[i].TitleRusult != "")
                        //        {
                        //            CheckResult = CheckResult + a.ToString() + "、 " + ListAnswerTitle[i].TitleRusult + "。" + Environment.NewLine;
                        //            a++;
                        //        }
                        //        if (ListAnswerTitle[i].TitleAdvice != "")
                        //        {
                        //            CheckAdvice = CheckAdvice + b.ToString() + "、 " + ListAnswerTitle[i].TitleAdvice + "。" + Environment.NewLine;
                        //            b++;
                        //        }
                        //    }
                        //    Session["CheckResult"] = CheckResult;
                        //    Session["CheckAdvice"] = CheckAdvice;
                        //}

                        Alert.ShowInTop("题目已答完", MessageBoxIcon.Information);
                        Session["IsAnswer"] = "0";
                        PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    }
                }
            }
            if (Request.QueryString["WhichPage"].ToString() == "ExeTask")
            {
                List <AnswerTitle> ListAnswerTaskTitle = Session["ExeTaskTitleClassList"] as List <AnswerTitle>;
                if (ListAnswerTaskTitle.Count > 0)
                {
                    if (Convert.ToInt32(Session["TitleIndexTask"]) == 0)
                    {
                        btn_LastTitle.Enabled = false;
                    }
                    if (Convert.ToInt32(Session["TitleIndexTask"]) < ListAnswerTaskTitle.Count)
                    {
                        //OnQueryAnswerByTitleID(null, answerArgs);
                        txtCheckTitleName.Text     = ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].TitleName;
                        areaCheckTitleContent.Text = ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].TitleContent;
                        DataTable dtAnswer = new DataTable();
                        int       a        = Convert.ToInt32(Session["TitleIndexTask"]);
                        if (ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].CheckedId == 0)
                        {
                            answerArgs.CheckTitleID = ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].TitleID;
                            CJia.HealthInspection.Models.AnswerModel answerModel = new Models.AnswerModel();
                            dtAnswer = answerModel.QuyerAnswerByTitleID(answerArgs.CheckTitleID);
                            if (dtAnswer != null && dtAnswer.Rows != null && dtAnswer.Rows.Count > 0)
                            {
                                ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].dtAnswer = dtAnswer;
                                ExtAspNet.RadioButtonList radioAnswer = new ExtAspNet.RadioButtonList();
                                radioAnswer.ID                    = "radioAnswer1";
                                radioAnswer.AutoPostBack          = true;
                                radioAnswer.Required              = true;
                                radioAnswer.SelectedIndexChanged += new EventHandler(radioAnswer_SelectedIndexChanged);
                                radioAnswer.Label                 = "选择答案";
                                for (int i = 0; i < dtAnswer.Rows.Count; i++)
                                {
                                    radioAnswer.Items.Add(new RadioItem(dtAnswer.Rows[i]["ANSWER_NAME"].ToString(), dtAnswer.Rows[i]["ANSWER_ID"].ToString()));
                                }
                                //radioAnswer.DataTextField = "ANSWER_NAME";
                                //radioAnswer.DataValueField = "ANSWER_ID";
                                //radioAnswer.DataSource = dtAnswer;
                                //radioAnswer.DataBind();
                                radioRow.Items.Add(radioAnswer);
                                Session["RadioButtonList"] = radioAnswer;
                                texCheckRusult.Readonly    = true;
                                txtCheckAdvice.Readonly    = true;
                            }
                            else
                            {
                                texCheckRusult.Readonly = false;
                                txtCheckAdvice.Readonly = false;
                                texCheckRusult.Text     = ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].TitleRusult;
                                txtCheckAdvice.Text     = ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].TitleAdvice;
                                //ExtAspNet.Alert.Show("此题没有答案");
                            }
                        }
                        else
                        {
                            dtAnswer = ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].dtAnswer;
                            if (dtAnswer != null && dtAnswer.Rows != null && dtAnswer.Rows.Count > 0)
                            {
                                ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].dtAnswer = dtAnswer;
                                ExtAspNet.RadioButtonList radioAnswer = new ExtAspNet.RadioButtonList();
                                radioAnswer.ID                    = "radioAnswer1";
                                radioAnswer.AutoPostBack          = true;
                                radioAnswer.Required              = true;
                                radioAnswer.SelectedIndexChanged += new EventHandler(radioAnswer_SelectedIndexChanged);
                                radioAnswer.Label                 = "选择答案";
                                for (int i = 0; i < dtAnswer.Rows.Count; i++)
                                {
                                    radioAnswer.Items.Add(new RadioItem(dtAnswer.Rows[i]["ANSWER_NAME"].ToString(), dtAnswer.Rows[i]["ANSWER_ID"].ToString()));
                                }
                                radioAnswer.Items[ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].CheckedIndex].Selected = true;
                                texCheckRusult.Text = ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].TitleRusult;
                                txtCheckAdvice.Text = ListAnswerTaskTitle[Convert.ToInt32(Session["TitleIndexTask"])].TitleAdvice;
                                radioRow.Items.Add(radioAnswer);
                                Session["RadioButtonList"] = radioAnswer;
                                texCheckRusult.Readonly    = true;
                                txtCheckAdvice.Readonly    = true;
                            }
                            //else
                            //{
                            //    ExtAspNet.Alert.Show("此题没有答案");
                            //}
                        }
                        Session["IsAnswer"] = "1";
                    }
                    else
                    {
                        //Session["ExeTaskTitleClassList"] = ListAnswerTaskTitle;
                        //if (Session["ExeTaskTitleClassList"] != null)
                        //{
                        //    string CheckResult = "XX市XX区卫生监督所卫生监督员【{0},{1}】,对【{2}】进行现场检查。检查人员向【{3}】负责人出示执法证并了解相关情况,经检查发现:" + Environment.NewLine; ;
                        //    string CheckAdvice = "";
                        //    int a = 1;
                        //    int b = 1;
                        //    //List<AnswerTitle> ListAnswerTitle1 = Session["ExeCheckTitleClassList"] as List<AnswerTitle>;
                        //    for (int i = 0; i < ListAnswerTaskTitle.Count; i++)
                        //    {
                        //        if (ListAnswerTaskTitle[i].TitleRusult != "")
                        //        {
                        //            CheckResult = CheckResult + a.ToString() + "、 " + ListAnswerTaskTitle[i].TitleRusult + "。" + Environment.NewLine;
                        //            a++;
                        //        }
                        //        if (ListAnswerTaskTitle[i].TitleAdvice != "")
                        //        {
                        //            CheckAdvice = CheckAdvice + b.ToString() + "、 " + ListAnswerTaskTitle[i].TitleAdvice + "。" + Environment.NewLine;
                        //            b++;
                        //        }
                        //    }
                        //    Session["CheckResultTask"] = CheckResult;
                        //    Session["CheckAdviceTask"] = CheckAdvice;
                        //}

                        Alert.ShowInTop("题目已答完", MessageBoxIcon.Information);
                        Session["IsAnswer"] = "0";
                        PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    }
                }
            }
        }
        /// <summary>
        /// 提交设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["Type"] != null && Request.QueryString["id"] != null)
            {
                if (!string.IsNullOrEmpty(txtpw1.Text) && !string.IsNullOrEmpty(txtpw2.Text))
                {
                    //密码是Juneberry_NJZBWX
                    if (txtpw1.Text == txtpw2.Text && SeatManage.SeatManageComm.MD5Algorithm.GetMD5Str32(txtpw2.Text) == "88C5884397D51468FA04ACFA46483AE4")
                    {
                        FineUI.Alert.Show("验证成功!");
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference());
                        switch (Request.QueryString["Type"])
                        {
                        case "School":
                            SeatManage.ClassModel.School school = new SeatManage.ClassModel.School();
                            school.No = Request.QueryString["id"];
                            if (!SeatManage.Bll.T_SM_School.DeleteSchool(school))
                            {
                                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                                FineUI.Alert.ShowInTop("删除失败!");
                            }
                            else
                            {
                                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                                FineUI.Alert.ShowInTop("删除完成!");
                            } break;

                        case "Library":
                            SeatManage.ClassModel.LibraryInfo library = new SeatManage.ClassModel.LibraryInfo();
                            library.No = Request.QueryString["id"];
                            if (!SeatManage.Bll.T_SM_Library.DeleteLibrary(library))
                            {
                                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                                FineUI.Alert.ShowInTop("删除失败!");
                            }
                            else
                            {
                                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                                FineUI.Alert.ShowInTop("删除完成!");
                            }
                            break;

                        case "ReadingRoom":
                            SeatManage.ClassModel.ReadingRoomInfo room = new SeatManage.ClassModel.ReadingRoomInfo();
                            room.No = Request.QueryString["id"];
                            if (!SeatManage.Bll.T_SM_ReadingRoom.DeleteReadingRoom(room))
                            {
                                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                                FineUI.Alert.ShowInTop("删除失败!");
                            }
                            else
                            {
                                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                                FineUI.Alert.ShowInTop("删除完成!");
                            }
                            break;
                        }
                    }
                    else
                    {
                        PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                        FineUI.Alert.ShowInTop("密码错误!");
                    }
                }
                else
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    FineUI.Alert.ShowInTop("密码不能为空!");
                    return;
                }
            }
            else
            {
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                FineUI.Alert.ShowInTop("加载页面失败,请重新打开");
            }
        }
Ejemplo n.º 19
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DateTime dt;
            string   errMsg = "";
            string   oxh    = this.lblXhOld.Text.Trim();
            string   oxm    = this.lblXmOld.Text.Trim();
            string   osj    = this.lblSjhmOld.Text.Trim();

            Model.Jcgl.Jc_xs xs = TU.Common.ConvertHelper.ConvertToEntity <Model.Jcgl.Jc_xs>("SimpleForm1", "SimpleForm2", "SimpleForm3", "SimpleForm4");
            xs.Pkid = Pkid;
            xs.Bmbh = TStar.Web.Globals.Account.DeptPkid;

            // 基本信息
            if (String.IsNullOrEmpty(xs.Xh))
            {
                errMsg += "请输入学号 !\n";
            }
            else if (BLL.Jcgl.Jc_xs.IsRepeated(xs.Pkid, "Xh", xs.Xh))
            {
                errMsg += "该学生已存在 !\n";
            }
            if (String.IsNullOrEmpty(xs.Xm))
            {
                errMsg += "请输入姓名 !\n";
            }
            if (xs.Dzbbh == "__")
            {
                errMsg += "请选择党支部 !\n";
            }
            if (xs.Zybh == "__")
            {
                errMsg += "请选择专业 !\n";
            }
            if (xs.Bjbh == "__")
            {
                errMsg += "请选择班级 !\n";
            }
            if (xs.Xbdm == "__")
            {
                errMsg += "请选择性别 !\n";
            }
            if (String.IsNullOrEmpty(xs.Sfzh))
            {
                errMsg += "请输入身份证号 !\n";
            }
            else if (xs.Sfzh.Length != 18)
            {
                errMsg += "身份证号长度不正确 !\n";
            }
            else if (BLL.Jcgl.Jc_xs.IsRepeated(xs.Pkid, "Sfzh", xs.Sfzh))
            {
                errMsg += "身份证号已存在 !\n";
            }
            else
            {
                int jcxb = int.Parse(xs.Sfzh[16].ToString());
                if (xs.Xbdm == "1" && jcxb % 2 == 0 || xs.Xbdm == "2" && jcxb % 2 == 1)
                {
                    errMsg += "身份证号的性别位不正确 !\n";
                }

                xs.Csrq = string.Format("{0}.{1}.{2}", xs.Sfzh.Substring(6, 4), xs.Sfzh.Substring(10, 2), xs.Sfzh.Substring(12, 2));
                if (!DateTime.TryParse(xs.Csrq, out dt))
                {
                    errMsg += "身份证号的出生日期位不正确 !\n";
                }
            }
            if (String.IsNullOrEmpty(xs.Sjhm))
            {
                errMsg += "请输入手机号码 !\n";
            }
            if (String.IsNullOrEmpty(xs.Mz))
            {
                errMsg += "请输入民族 !\n";
            }
            if (String.IsNullOrEmpty(xs.Jg))
            {
                errMsg += "请输入籍贯 !\n";
            }
            if (String.IsNullOrEmpty(xs.Zw))
            {
                errMsg += "请输入职务 !\n";
            }
            if (String.IsNullOrEmpty(xs.Jtdz))
            {
                errMsg += "请输入家庭地址 !\n";
            }
            // 发展前信息
            if (String.IsNullOrEmpty(xs.Sqrdrq))
            {
                errMsg += "请输入申请入党日期 !\n";
            }
            else if (!DateTime.TryParse(xs.Sqrdrq, out dt))
            {
                errMsg += "申请入党日期不正确 !\n";
            }
            if (String.IsNullOrEmpty(xs.Jjfzrq))
            {
                errMsg += "请输入积极分子日期 !\n";
            }
            else if (!DateTime.TryParse(xs.Jjfzrq, out dt))
            {
                errMsg += "积极分子日期不正确 !\n";
            }
            if (xs.Rdlxrbh1 == "__")
            {
                errMsg += "请选择入党联系人 !\n";
            }
            // 发展后信息
            if (!this.gplFzh.Hidden)
            {
                xs.Rdrq  = this.tbxRdrq.Text.Trim();
                xs.Zysbh = this.tbxZysbh.Text.Trim();
                xs.Zzrq  = this.tbxZzrq.Text.Trim();

                if (String.IsNullOrEmpty(xs.Rdrq))
                {
                    errMsg += "请输入入党日期 !\n";
                }
                else if (!DateTime.TryParse(xs.Rdrq, out dt))
                {
                    errMsg += "入党日期不正确 !\n";
                }
                if (String.IsNullOrEmpty(xs.Zysbh))
                {
                    errMsg += "请输入志愿书编号 !\n";
                }
                else if (BLL.Jcgl.Jc_xs.IsRepeated(xs.Pkid, "Zysbh", xs.Zysbh))
                {
                    errMsg += "志愿书编号已存在 !\n";
                }
                if (String.IsNullOrEmpty(xs.Zzrq))
                {
                    if (((int)TStar.Web.Globals.SystemSetting.Fzzt.Zsdy).ToString() == xs.Fzztdm)
                    {
                        errMsg += "请输入转正日期 !\n";
                    }
                }
                else if (!DateTime.TryParse(xs.Zzrq, out dt))
                {
                    errMsg += this.tbxZzrq.Label.Replace(" ", "") + "不正确 !\n";
                }
            }
            if (errMsg.Length > 0)
            {
                Alert.Show(errMsg, "保存提示", MessageBoxIcon.Warning);
                return;
            }

            try
            {
                if (BLL.Jcgl.Jc_xs.Update(xs, xs.Xh != oxh || xs.Xm != oxm || xs.Sjhm != osj))
                {
                    PageContext.RegisterStartupScript(Alert.GetShowInParentReference("保存成功 !", "操作完成", MessageBoxIcon.Information) + ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.Show("未成功保存,请与管理员联系 !", "保存失败", MessageBoxIcon.Warning);
                }
            }
            catch (Exception err)
            {
                Alert.Show(err.Message, "保存失败", MessageBoxIcon.Error);
            }
        }
        /// <summary>
        /// 绑定UI元素
        /// </summary>
        /// <param name="seatNo"></param>
        /// <param name="seatShortNo"></param>GetBespeakLogInfoBySeatNo
        void BindUIElement(string seatNo, string seatShortNo, DateTime date)
        {
            SeatManage.ClassModel.ReadingRoomInfo room           = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(roomNo);
            SeatManage.Bll.T_SM_ReadingRoom       bllReadingRoom = new SeatManage.Bll.T_SM_ReadingRoom();
            foreach (DateTime dt in room.Setting.SeatBespeak.SpecifiedTimeList)
            {
                DropDownList_Time.Items.Add(new FineUI.ListItem(dt.ToShortTimeString(), dt.ToShortTimeString()));
            }
            DateTime minTime = DateTime.Parse(date.ToShortDateString() + " " + bllReadingRoom.GetRoomOpenTimeByDate(room.Setting, date.ToShortDateString()).BeginTime);

            while (true)
            {
                minTime = minTime.AddMinutes(10);
                if (minTime.Date > date.Date)
                {
                    break;
                }
                if (Code.NowReadingRoomState.ReadingRoomOpenState(room.Setting.RoomOpenSet, minTime) == SeatManage.EnumType.ReadingRoomStatus.Close)
                {
                    continue;
                }
                DropDownList_FreeTime.Items.Add(new FineUI.ListItem(minTime.ToShortTimeString(), minTime.ToShortTimeString()));
            }
            if (!room.Setting.SeatBespeak.SpecifiedBespeak)
            {
                rblModel.Hidden = true;
            }
            if (rblModel.SelectedValue == "0")
            {
                DropDownList_FreeTime.Hidden = true;
                DropDownList_Time.Hidden     = true;
            }
            else
            {
                if (!room.Setting.SeatBespeak.SpecifiedTime)
                {
                    DropDownList_Time.Hidden     = true;
                    DropDownList_FreeTime.Hidden = false;
                }
                else
                {
                    DropDownList_FreeTime.Hidden = true;
                    DropDownList_Time.Hidden     = false;
                }
            }
            lblbeginDate.Text     = date.ToShortDateString();
            this.lblSeatNo.Text   = seatShortNo;
            this.lblRoomName.Text = room.Name;
            //判断自己是否已经预约座位
            List <SeatManage.EnumType.BookingStatus> bespeakStatus = new List <SeatManage.EnumType.BookingStatus>();

            bespeakStatus.Add(SeatManage.EnumType.BookingStatus.Waiting);
            List <SeatManage.ClassModel.BespeakLogInfo> readerBespeaklist = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakLogInfoByCardNo(this.LoginId, date);//.GetBespeakList(this.LoginId, null, date, 0, bespeakStatus);

            if (readerBespeaklist.Count > 0)
            {
                FineUI.Alert.ShowInTop("您选择的日期已经预约了座位,请先取消原来的预约。");
                btnBespeak.Enabled = false;
                PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                return;
            }
            //判断座位是否被别人预约
            List <SeatManage.ClassModel.BespeakLogInfo> list = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakLogInfoBySeatNo(seatNo, date);

            roomOpenTime.Value   = bllReadingRoom.GetRoomOpenTimeByDate(room.Setting, date.ToShortDateString()).BeginTime;
            this.lblEndDate.Text = bespeakSureTimeSpan(room.Setting);
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].BsepeakState == SeatManage.EnumType.BookingStatus.Waiting)
                {
                    FineUI.Alert.ShowInTop("座位已经被别人预约,请预约其他座位");
                    btnBespeak.Enabled = false;
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    return;
                }
            }
            //判断是否已加入黑名单
            List <SeatManage.ClassModel.BlackListInfo> blacklistInfoByCardNo = SeatManage.Bll.T_SM_Blacklist.GetBlackListInfo(this.LoginId);

            SeatManage.ClassModel.RegulationRulesSetting rulesSet = SeatManage.Bll.T_SM_SystemSet.GetRegulationRulesSetting();
            if (room.Setting.UsedBlacklistLimit && blacklistInfoByCardNo.Count > 0)
            {
                if (room.Setting.BlackListSetting.Used)
                {
                    bool isblack = false;
                    foreach (SeatManage.ClassModel.BlackListInfo blinfo in blacklistInfoByCardNo)
                    {
                        if (blinfo.ReadingRoomID == room.No)
                        {
                            isblack = true;
                            break;
                        }
                    }
                    if (isblack)
                    {
                        FineUI.Alert.ShowInTop("你已进入黑名单,不能在该阅览室预约座位");
                        PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                        return;
                    }
                }
                else
                {
                    FineUI.Alert.ShowInTop("你已进入黑名单,不能在该阅览室预约座位");
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                    return;
                }
            }
            if (room.Setting.LimitReaderEnter.Used)
            {
                SeatManage.ClassModel.ReaderInfo readerInfo = SeatManage.Bll.EnterOutOperate.GetReaderInfo(this.LoginId);
                string[] litype = room.Setting.LimitReaderEnter.ReaderTypes.Split(';');
                if (!room.Setting.LimitReaderEnter.CanEnter)
                {
                    foreach (string type in litype)
                    {
                        if (type == readerInfo.ReaderType)
                        {
                            FineUI.Alert.ShowInTop("你的读者类型不能在该阅览室预约座位");
                            PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                            return;
                        }
                    }
                }
                else
                {
                    bool isintype = false;
                    foreach (string type in litype)
                    {
                        if (type == readerInfo.ReaderType)
                        {
                            isintype = true;
                            break;
                        }
                    }
                    if (!isintype)
                    {
                        FineUI.Alert.ShowInTop("你的读者类型不能在该阅览室预约座位");
                        PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                        return;
                    }
                }
            }

            btnBespeak.Enabled = true;
        }
Ejemplo n.º 21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["flag"] == "edit")
     {
         if (!IsPostBack)
         {
             DataBind();
         }
         extform.Hidden    = false;
         remarkform.Hidden = true;
         btnApp.Hidden     = true;
         btnSubmit.Hidden  = false;
     }
     else
     {
         string roomNo = Request.QueryString["roomNo"];
         if (string.IsNullOrEmpty(roomNo))
         {
             PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
             FineUI.Alert.ShowInTop("数据获取失败!");
         }
         else
         {
             SeatManage.ClassModel.StudyRoomInfo room = SeatManage.Bll.StudyRoomOperation.GetSingleStudyRoonInfo(roomNo);
             if (room == null)
             {
                 PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                 FineUI.Alert.ShowInTop("数据获取失败!");
             }
             else
             {
                 if (!IsPostBack)
                 {
                     DateTime nowT = SeatManage.Bll.ServiceDateTime.Now;
                     tpBookingTime.MinTime      = room.Setting.OpenTime;
                     tpBookingTime.MaxTime      = room.Setting.CloseTime;
                     tpBookingTime.SelectedDate = room.Setting.OpenTime;
                     dpBookingDate.MinDate      = nowT;
                     dpBookingDate.SelectedDate = nowT;
                     nbUseTime.MinValue         = 1;
                     string[] cbul = room.Setting.CanUseFacilities.Split(';');
                     if (cbul.Length > 0)
                     {
                         cbUse.Items.Clear();
                         foreach (string item in cbul)
                         {
                             if (string.IsNullOrEmpty(item))
                             {
                                 continue;
                             }
                             cbUse.Items.Add(new CheckItem(item, item));
                         }
                     }
                     txtFacilitiesRenmark.InnerHtml = room.Setting.FacilitiesRenmark.Replace("\r\n", "<br/>").Replace(" ", "&nbsp;");
                     txtPrecautions.InnerHtml       = room.Setting.Precautions.Replace("\r\n", "<br/>").Replace(" ", "&nbsp;");
                     txtApplicationInfo.InnerHtml   = room.Setting.ApplicationInfo.Replace("\r\n", "<br/>").Replace(" ", "&nbsp;");
                     string imageWebUrl = ConfigurationManager.AppSettings["imageUrl"];
                     imgRoomImage.ImageUrl = imageWebUrl + "StudyImage/" + room.RoomImage;
                     string u = Server.UrlEncode(imgRoomImage.ImageUrl);
                     btnImage.OnClientClick = WindowImage.GetShowReference(string.Format("BigImage.aspx?imageurl={0}", u), "大图");
                     extform.Hidden         = true;
                     remarkform.Hidden      = false;
                     btnSubmit.Hidden       = true;
                     btnApp.Hidden          = false;
                     if (!room.Setting.IsUseStudyRoom)
                     {
                         btnApp.Enabled = false;
                         btnApp.ToolTip = "本研习间暂不开放";
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 22
0
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();
            diseasesDto     objDiseaseDto      = new diseasesDto();
            diseasesDto     objDiseaseDto1     = new diseasesDto();

            if (Session["DiseasesId"] != null)
            {
                objDiseaseDto = oServiceBL.GetDiseases(ref objOperationResult, Session["DiseasesId"].ToString());

                objDiseaseDto.v_CIE10Id = Session["Cie10Id"].ToString();
                objDiseaseDto.v_Name    = txtDxModificado.Text;
                oServiceBL.UpdateDiseases(ref objOperationResult, objDiseaseDto, ((ClientSession)Session["objClientSession"]).GetAsList());

                //_objDiseasesList.v_DiseasesId = objDiseaseDto.v_DiseasesId;
                //_objDiseasesList.v_CIE10Id = objDiseaseDto.v_CIE10Id;
                //_objDiseasesList.v_Name = objDiseaseDto.v_Name;
            }
            else
            {
                objDiseaseDto.v_CIE10Id = Session["Cie10Id"].ToString();
                objDiseaseDto.v_Name    = txtDxModificado.Text;


                objDiseaseDto1 = oServiceBL.GetIsValidateDiseases(ref objOperationResult, objDiseaseDto.v_Name);

                if (objDiseaseDto1 == null)
                {
                    objDiseaseDto.v_DiseasesId = oServiceBL.AddDiseases(ref objOperationResult, objDiseaseDto, ((ClientSession)Session["objClientSession"]).GetAsList());
                }
                else
                {
                    Alert.Show("Escoja uno que tenga código interno", "Error de validación", MessageBoxIcon.Warning);
                    return;
                }
            }

            //Grabar el Dx en el servicio


            Sigesoft.Node.WinClient.BE.DiagnosticRepositoryList        _diagnosticRepository      = new Sigesoft.Node.WinClient.BE.DiagnosticRepositoryList();
            List <Sigesoft.Node.WinClient.BE.DiagnosticRepositoryList> _ListadiagnosticRepository = new List <Sigesoft.Node.WinClient.BE.DiagnosticRepositoryList>();

            _diagnosticRepository.v_DiagnosticRepositoryId = Guid.NewGuid().ToString();
            _diagnosticRepository.v_DiseasesId             = Session["DiseasesId"] == null ? objDiseaseDto.v_DiseasesId : Session["DiseasesId"].ToString();
            _diagnosticRepository.i_AutoManualId           = 1;
            _diagnosticRepository.i_PreQualificationId     = 1;
            _diagnosticRepository.i_FinalQualificationId   = (int)FinalQualification.Definitivo;
            _diagnosticRepository.i_DiagnosticTypeId       = (int)TipoDx.Enfermedad_Comun;

            _diagnosticRepository.v_ServiceId    = Session["ServiceId"].ToString();
            _diagnosticRepository.v_ComponentId  = ddlExamen.SelectedValue.ToString(); //_componentId;
            _diagnosticRepository.v_DiseasesName = objDiseaseDto.v_Name;
            _diagnosticRepository.i_RecordStatus = (int)RecordStatus.Agregado;
            _diagnosticRepository.i_RecordType   = (int)RecordType.Temporal;
            _diagnosticRepository.Restrictions   = null;
            _diagnosticRepository.Recomendations = null;

            _ListadiagnosticRepository.Add(_diagnosticRepository);

            oServiceBL.AddDiagnosticRepository(ref objOperationResult, _ListadiagnosticRepository, null, ((ClientSession)Session["objClientSession"]).GetAsList(), true);

            if (objOperationResult.Success == 1)  // Operación sin error
            {
                // Cerrar página actual y hacer postback en el padre para actualizar
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else  // Operación con error
            {
                Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult.ExceptionMessage);
                // Se queda en el formulario.
            }
        }
Ejemplo n.º 23
0
        //保存机构信息
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (AgencyName2.Text.Trim() == "")
                {
                    Alert.ShowInTop("机构名称不能为空!");
                    AgencyName2.Text = "";
                    return;
                }
                if (AgencyHeads2.Text.Trim() == "")
                {
                    Alert.ShowInTop("机构负责人不能为空!");
                    AgencyHeads2.Text = "";
                    return;
                }
                if (FullTimeNumber2.Text.Trim() == "")
                {
                    Alert.ShowInTop("专职人数不能为空!");
                    FullTimeNumber2.Text = "";
                    return;
                }
                Common.Entities.Agency       ag   = agen.FindByName(Session["AgencyName"].ToString());
                Common.Entities.OperationLog op   = new Common.Entities.OperationLog();
                BLHelper.BLLOperationLog     blop = new BLHelper.BLLOperationLog();

                ag.AgencyName      = AgencyName2.Text.ToString();
                ag.ParentID        = agen.SelectAgencyID(ParentID2.Text.ToString());
                ag.SecrecyLevel    = Convert.ToInt32(DroSecrecyLevel.SelectedIndex + 1);
                ag.AgencyID        = agen.SelectAgencyID(AgencyName2.Text.Trim());
                ag.AgencyHeads     = AgencyHeads2.Text.ToString();
                ag.Research        = Research2.Text.ToString();
                ag.AgencyNumber    = DroAgencyNumber.SelectedText;
                ag.FullTimeNumbers = Convert.ToInt32(FullTimeNumber2.Text.ToString());
                ag.PartTimeNumbers = Convert.ToInt32(PartTimeNumber2.Text.ToString());
                ag.Area            = Area2.Text.ToString();
                ag.Location        = Location2.Text.ToString();
                ag.IsGlobal        = ddl_glo.SelectedText.Trim();
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    ag.IsPass = true;
                    agen.Update(ag);
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("保存成功") + Alert.GetShowInTopReference("保存成功"));
                }
                else
                {
                    ag.IsPass = false;
                    agen.Update(ag);
                    op.LoginIP          = "";
                    op.LoginName        = Session["LoginName"].ToString();
                    op.OperationContent = "Agency";
                    op.OperationDataID  = ag.AgencyID;
                    op.OperationType    = "更新";
                    op.OperationTime    = DateTime.Now;
                    blop.Insert(op);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("您的操作已经提交,请等待管理员确认!"));
                }
            }
            catch (Exception ex)
            {
                BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
        }
        protected void RISK_Add_Click(object sender, EventArgs e)
        {
            try
            {
                var db   = new SAFEDB();
                var risk = new TH_TRISK01("new");
                risk.FEATURE_CODE = this.FEATURE_CODE.Text;
                var parentHAZA = (from x in db.TH_THAZA01
                                  where x.HAZA_ID == risk.FEATURE_CODE
                                  select x).FirstOrDefault();
                var user = new AdvUserInfo(GetIdentityName());

                risk.REC_CREATOR = user.USER_ID;
                risk.RISK_DEPT   = user.GetDept();
                risk.RISK_STATUS = this.RISK_STATUS.SelectedValue;

                try
                {
                    risk.RISK_L = decimal.Parse(this.RISK_L.Text);
                }
                catch
                {
                    risk.RISK_L = 0;
                }
                try
                {
                    risk.RISK_E = decimal.Parse(this.RISK_E.Text);
                }
                catch
                {
                    risk.RISK_E = 0;
                }
                try
                {
                    risk.RISK_C = decimal.Parse(this.RISK_C.Text);
                }
                catch
                {
                    risk.RISK_C = 0;
                }
                try
                {
                    risk.RISK_D = decimal.Parse(this.RISK_D.Text);
                }
                catch
                {
                    RISKCalc(sender, e);
                    risk.RISK_L = decimal.Parse(this.RISK_D.Text);
                }

                risk.RISK_SOL       = ReadSOL_Grid();
                risk.RISK_LVL       = this.RISK_LVL.Text;
                risk.RISK_MOD       = this.RISK_MOD.Text;
                risk.RISK_DECONTENT = this.RISK_DESC.Text;
                //var re = risk.AddtoDB();
                var a = db.Set <TH_TRISK01>().Add(risk);
                db.SaveChanges();
                db.Dispose();
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("add" + "_" + risk.RISK_ID));
            }
            catch (Exception ex)
            {
                Notify.ShowMessage(ex.Message);
            }
        }
Ejemplo n.º 25
0
        protected void btnSubmit_OnClick(object sender, EventArgs e)
        {
            int id = -1;

            SeatManage.ClassModel.StudyBookingLog model = null;;
            if (Request.QueryString["id"] != null)
            {
                id    = int.Parse(Request.QueryString["id"]);
                model = SeatManage.Bll.StudyRoomOperation.GetStudyBookingLogByID(id);
            }
            if (model == null)
            {
                model = new SeatManage.ClassModel.StudyBookingLog();
            }
            model.Application.ApplicantCardNo    = txtApplicantCardNo.Text;
            model.Application.ApplicantDept      = txtApplicantDept.Text;
            model.Application.ApplicantName      = txtApplicantName.Text;
            model.Application.ApplicantPhoneNum  = txtApplicantPhoneNum.Text;
            model.Application.ApplicantType      = txtApplicantType.Text;
            model.Application.HeadPerson         = txtHeadPerson.Text;
            model.Application.HeadPersonPhoneNum = txtHeadPersonPhoneNum.Text;
            model.Application.HeadPersonType     = txtHeadPersonType.Text;
            model.Application.MeetingName        = txtMeetingName.Text;
            model.Application.MembersCount       = int.Parse(txtMembersCount.Text);
            model.Application.UseProjector       = "";
            foreach (CheckItem ci in cbUse.Items)
            {
                if (ci.Selected)
                {
                    model.Application.UseProjector += ci.Value + ";";
                }
            }
            model.BespeakTime = DateTime.Parse(dpBookingDate.Text + " " + tpBookingTime.Text);
            model.UseTime     = int.Parse(nbUseTime.Text);
            if (Request.QueryString["flag"] != "edit")
            {
                model.StudyRoomNo = Request.QueryString["roomNo"];
            }
            model.SubmitTime = SeatManage.Bll.ServiceDateTime.Now;
            model.CheckState = SeatManage.EnumType.CheckStatus.Checking;
            model.CardNo     = this.LoginId;
            model.Application.EmailAddress = txtemail.Text;
            string errorMessage = SeatManage.Bll.StudyRoomOperation.CheckBookTime(model.BespeakTime, model.UseTime, model.StudyRoomNo, model.StudyID);

            if (!string.IsNullOrEmpty(errorMessage))
            {
                FineUI.Alert.ShowInTop(errorMessage);
                return;
            }
            if (Request.QueryString["flag"] == "edit")
            {
                if (SeatManage.Bll.StudyRoomOperation.UpdateStudyBookingLog(model))
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    FineUI.Alert.ShowInTop("提交成功!");
                }
                else
                {
                    FineUI.Alert.ShowInTop("保存失败!");
                }
            }
            else
            {
                if (SeatManage.Bll.StudyRoomOperation.AddStudyBookingLog(model))
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    FineUI.Alert.ShowInTop("提交成功!");
                }
                else
                {
                    FineUI.Alert.ShowInTop("保存失败!");
                }
            }
        }
Ejemplo n.º 26
0
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();
            string          Mode     = Request.QueryString["Mode"].ToString();
            string          PersonId = "";

            if (Request.QueryString["v_PersonId"] != null)
            {
                PersonId = Request.QueryString["v_PersonId"].ToString();
            }


            if (Mode == "New")
            {
                familymedicalantecedentsDto personmedicalhistoryDtoDto = new familymedicalantecedentsDto();
                var x = ddlDx.SelectedText.ToString().Split('|');
                //Obtener Disease
                systemparameterDto objEntity = _objBL.GetSystemParameter(ref objOperationResult, 149, int.Parse(x[1].ToString()));



                personmedicalhistoryDtoDto.v_PersonId = Session["PersonId"].ToString();

                personmedicalhistoryDtoDto.i_TypeFamilyId = int.Parse(x[1].ToString());

                if (ddlDx.SelectedValue == "80" || ddlDx.SelectedValue == "81" || ddlDx.SelectedValue == "82" || ddlDx.SelectedValue == "83" || ddlDx.SelectedValue == "84")
                {
                    personmedicalhistoryDtoDto.v_DiseasesId = Session["OtroDxId"].ToString();
                }
                else
                {
                    personmedicalhistoryDtoDto.v_DiseasesId = objEntity.v_Value1;
                }

                personmedicalhistoryDtoDto.v_Comment = txtComentario.Text;

                _objHistoryBL.AddFamiliar(ref objOperationResult, personmedicalhistoryDtoDto, ((ClientSession)Session["objClientSession"]).GetAsList());
            }
            else if (Mode == "Edit")
            {
                familymedicalantecedentsDto personmedicalhistoryDtoDto = (familymedicalantecedentsDto)Session["objEntity"];

                var x = ddlDx.SelectedText.ToString().Split('|');

                //Obtener Disease
                systemparameterDto objEntity = _objBL.GetSystemParameter(ref objOperationResult, 149, int.Parse(x[1].ToString()));


                //personmedicalhistoryDtoDto.v_DiseasesId = objEntity.v_Value1;
                if (ddlDx.SelectedValue == "80" || ddlDx.SelectedValue == "81" || ddlDx.SelectedValue == "82" || ddlDx.SelectedValue == "83" || ddlDx.SelectedValue == "84")
                {
                    personmedicalhistoryDtoDto.v_DiseasesId = Session["OtroDxId"].ToString();
                }
                else
                {
                    personmedicalhistoryDtoDto.v_DiseasesId = objEntity.v_Value1;
                }

                personmedicalhistoryDtoDto.v_Comment      = txtComentario.Text;
                personmedicalhistoryDtoDto.i_TypeFamilyId = int.Parse(x[1].ToString());

                _objHistoryBL.UpdateFamiliar(ref objOperationResult, personmedicalhistoryDtoDto, ((ClientSession)Session["objClientSession"]).GetAsList());
            }
            Session["GrupoFamiliarId"] = null;
            //Analizar el resultado de la operación
            if (objOperationResult.Success == 1)  // Operación sin error
            {
                // Cerrar página actual y hacer postback en el padre para actualizar
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else  // Operación con error
            {
                Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult.ExceptionMessage);
                // Se queda en el formulario.
            }
        }
Ejemplo n.º 27
0
        private void SaveXmzm(string xmbh)
        {
            string        errMsg   = "";
            List <string> lstFiles = new List <string>();

            // 检查附件信息
            for (int i = 0; i < this.tbs.Length; i++)
            {
                errMsg += CheckInfo(i);
            }
            if (errMsg.Length > 0)
            {
                Alert.Show(errMsg, "上传提示", MessageBoxIcon.Warning);
                return;
            }

            // 保存附件信息
            for (int no = 0, i = 0; i < this.lstXhs.Count; i++)
            {
                try
                {
                    no = this.lstXhs[i];
                    string   zy      = hfds[no].Text; // 原始附件信息
                    string   clbt    = tbs[no].Text;
                    string   cflj    = hhfs[no].Value;
                    string[] zys     = zy.Split('|');
                    bool     isDel   = cflj.StartsWith("Del@") && !String.IsNullOrEmpty(zy);
                    bool     hasFile = !String.IsNullOrEmpty(cflj) && !cflj.StartsWith("Del@");
                    bool     isAdd   = String.IsNullOrEmpty(zy) && hasFile;
                    bool     isMod   = !isAdd && !isDel && (clbt != zys[1] || cflj != zys[2]);

                    if (isAdd || isDel || isMod)
                    {
                        // 保存附件
                        Model.Yjgl.Yj_xmzm zm = new Model.Yjgl.Yj_xmzm();
                        zm.Pkid = zys[0];
                        zm.Xmbh = Xmbh;
                        zm.Clbt = clbt;
                        zm.Cflj = hhfs[no].Value;
                        if (!isAdd)
                        {
                            zm.OldCflj = zys[2];
                        }
                        BLL.Xmgl.Yj_xmzm.Save(zm);
                    }
                }
                catch (Exception err)
                {
                    Alert.Show(err.Message, string.Format("保存附件{0}失败", szs[no]), MessageBoxIcon.Error);
                    return;
                }
            }

            // 清理临时文件
            string bmbh  = TStar.Web.Globals.Account.DeptPkid;
            string dzbbh = TStar.Web.Globals.Account.UserInfo.Dzbbh;
            string xsbh  = TStar.Web.Globals.Account.Pkid;

            ClearTmpFiles(bmbh, dzbbh, xsbh, Xmbh);

            PageContext.RegisterStartupScript(Alert.GetShowInParentReference("项目证明材料保存成功 !", "操作完成", MessageBoxIcon.Information) + ActiveWindow.GetHidePostBackReference());
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 将Dataset的数据导入数据库
        /// </summary>
        /// <param name="pds">数据集</param>
        /// <param name="Cols">数据集列数</param>
        /// <returns></returns>
        private bool AddDatasetToSQL(DataTable pds, int Cols)
        {
            int ic, ir;

            reports.Clear();
            ic = pds.Columns.Count;
            if (ic < Cols)
            {
                ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning);
            }

            ir = pds.Rows.Count;
            if (pds != null && ir > 0)
            {
                var units = from x in Funs.DB.Base_Unit select x;

                for (int i = 1; i < ir; i++)
                {
                    Model.View_Information_DrillConductedQuarterlyReportItem report = new Model.View_Information_DrillConductedQuarterlyReportItem();
                    string row1  = pds.Rows[i][0].ToString().Trim();
                    string row2  = pds.Rows[i][1].ToString().Trim();
                    string row3  = pds.Rows[i][2].ToString().Trim();
                    string row4  = pds.Rows[i][3].ToString().Trim();
                    string row5  = pds.Rows[i][4].ToString().Trim();
                    string row6  = pds.Rows[i][5].ToString().Trim();
                    string row7  = pds.Rows[i][6].ToString().Trim();
                    string row8  = pds.Rows[i][7].ToString().Trim();
                    string row9  = pds.Rows[i][8].ToString().Trim();
                    string row10 = pds.Rows[i][9].ToString().Trim();
                    string row11 = pds.Rows[i][10].ToString().Trim();
                    string row12 = pds.Rows[i][11].ToString().Trim();
                    string row13 = pds.Rows[i][12].ToString().Trim();
                    string row14 = pds.Rows[i][13].ToString().Trim();
                    string row15 = pds.Rows[i][14].ToString().Trim();
                    string row16 = pds.Rows[i][15].ToString().Trim();
                    string row17 = pds.Rows[i][16].ToString().Trim();
                    string row18 = pds.Rows[i][17].ToString().Trim();
                    string row19 = pds.Rows[i][18].ToString().Trim();
                    if (!string.IsNullOrEmpty(row1))
                    {
                        report.UnitId = units.Where(x => x.UnitName == row1.Trim()).FirstOrDefault().UnitId;
                    }
                    if (!string.IsNullOrEmpty(row2))
                    {
                        report.YearId = Convert.ToInt32(row2);
                    }
                    if (!string.IsNullOrEmpty(row3))
                    {
                        report.Quarter = Convert.ToInt32(row3);
                    }
                    report.IndustryType = row4;
                    if (!string.IsNullOrEmpty(row5))
                    {
                        report.TotalConductCount = Convert.ToInt32(row5);
                    }
                    if (!string.IsNullOrEmpty(row6))
                    {
                        report.TotalPeopleCount = Convert.ToInt32(row6);
                    }
                    if (!string.IsNullOrEmpty(row7))
                    {
                        report.TotalInvestment = Convert.ToDecimal(row7);
                    }
                    if (!string.IsNullOrEmpty(row8))
                    {
                        report.HQConductCount = Convert.ToInt32(row8);
                    }
                    if (!string.IsNullOrEmpty(row9))
                    {
                        report.HQPeopleCount = Convert.ToInt32(row9);
                    }
                    if (!string.IsNullOrEmpty(row10))
                    {
                        report.HQInvestment = Convert.ToDecimal(row10);
                    }
                    if (!string.IsNullOrEmpty(row11))
                    {
                        report.BasicConductCount = Convert.ToInt32(row11);
                    }
                    if (!string.IsNullOrEmpty(row12))
                    {
                        report.BasicPeopleCount = Convert.ToInt32(row12);
                    }
                    if (!string.IsNullOrEmpty(row13))
                    {
                        report.BasicInvestment = Convert.ToDecimal(row13);
                    }
                    if (!string.IsNullOrEmpty(row14))
                    {
                        report.ComprehensivePractice = Convert.ToInt32(row14);
                    }
                    if (!string.IsNullOrEmpty(row15))
                    {
                        report.CPScene = Convert.ToInt32(row15);
                    }
                    if (!string.IsNullOrEmpty(row16))
                    {
                        report.CPDesktop = Convert.ToInt32(row16);
                    }
                    if (!string.IsNullOrEmpty(row17))
                    {
                        report.SpecialDrill = Convert.ToInt32(row17);
                    }
                    if (!string.IsNullOrEmpty(row18))
                    {
                        report.SDScene = Convert.ToInt32(row18);
                    }
                    if (!string.IsNullOrEmpty(row19))
                    {
                        report.SDDesktop = Convert.ToInt32(row19);
                    }

                    if (reports.Where(e => e.DrillConductedQuarterlyReportItemId == report.DrillConductedQuarterlyReportItemId).FirstOrDefault() == null)
                    {
                        report.DrillConductedQuarterlyReportItemId = SQLHelper.GetNewID(typeof(Model.View_Information_DrillConductedQuarterlyReportItem));
                        reports.Add(report);
                    }
                }
                Session["reports"] = reports;
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else
            {
                ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
            }
            return(true);
        }
Ejemplo n.º 29
0
 protected void btnSaveClose_Click(object sender, EventArgs e)
 {
     SaveItem();
     PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
 }
Ejemplo n.º 30
0
        protected void btnSaveClose_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
            {
                string       Id = Request.QueryString["Id"];
                Model.tTopic m  = bll.GetModel(Convert.ToInt32(Id));
                if (m == null)
                {
                    return;
                }
                string content1 = Request.Form["editorNew"] == null ? "" : Request.Form["editorNew"];
                string content2 = Request.Form["editorNew2"] == null ? "" : Request.Form["editorNew2"];
                m.policyFile    = content2;
                m.topicFile     = content1;
                m.policyDptName = txtDptName.Text;
                m.topicTitle    = txtTitle.Text;
                m.topicTime     = DateTimeCh.SelectedDate;
                m.policyTime    = DateTimeTop.SelectedDate;
                m.policyAdress  = txtAdress.Text;
                m.policyPeople  = txtPeo.Text;
                m.policyProcess = txtProcess.Text;
                m.policyResult  = txtRs.Text;
                m.policyDone    = txtDone.Text;

                if (bll.Update(m) == true)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInTop("出错了!");
                }
            }
            else
            {
                Model.tTopic m        = new Model.tTopic();
                string       content1 = Request.Form["editorNew"] == null ? "" : Request.Form["editorNew"];
                string       content2 = Request.Form["editorNew2"] == null ? "" : Request.Form["editorNew2"];
                m.policyFile    = content2;
                m.topicFile     = content1;
                m.policyDptName = txtDptName.Text;
                m.topicTitle    = txtTitle.Text;
                m.topicTime     = DateTimeCh.SelectedDate;
                m.policyTime    = DateTimeTop.SelectedDate;
                m.policyAdress  = txtAdress.Text;
                m.policyPeople  = txtPeo.Text;
                m.policyProcess = txtProcess.Text;
                m.policyResult  = txtRs.Text;
                m.policyDone    = txtDone.Text;
                m.policyDptId   = int.Parse(Request.QueryString["dptId"]);
                Model.tUsers user = GetIdentityUser();
                m.savePeo    = user.usersName;
                m.savePeoId  = user.userId;
                m.policyType = int.Parse(Request.QueryString["tId"]);
                int k = bll.Add(m);

                if (k > 0)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
            }
        }