예제 #1
0
        public void DelLsc(int lscId)
        {
            try {
                var lscEntity = new BLsc();
                lscEntity.DelLsc(lscId);

                var order = new OrderInfo();
                order.LscID      = lscId;
                order.TargetID   = -1;
                order.TargetType = EnmNodeType.Null;
                order.OrderType  = EnmActType.DeleteLsc;
                order.RelValue1  = Page.User.Identity.Name;
                order.RelValue2  = WebUtility.GetClientIP();
                order.RelValue3  = WebUtility.DefaultString;
                order.RelValue4  = WebUtility.DefaultString;
                order.RelValue5  = WebUtility.DefaultString;
                order.UpdateTime = DateTime.Now;

                var orderEntity = new BOrder();
                orderEntity.AddOrder(order);
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }
예제 #2
0
        protected void gvLsc_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try {
                if (String.IsNullOrEmpty(e.CommandArgument.ToString()))
                {
                    return;
                }
                var lscId     = Int32.Parse(e.CommandArgument.ToString());
                var lscEntity = new BLsc();
                switch (e.CommandName)
                {
                case "Select":
                    LscIDTextBox.Text   = String.Empty;
                    LscNameTextBox.Text = String.Empty;
                    LscIPTextBox.Text   = String.Empty;
                    LscPortTextBox.Text = String.Empty;
                    LscUIDTextBox.Text  = String.Empty;
                    LscPwdTextBox.Attributes["value"] = String.Empty;
                    BeatIntervalTextBox.Text          = String.Empty;
                    BeatDelayTextBox.Text             = String.Empty;
                    DBIPTextBox.Text   = String.Empty;
                    DBPortTextBox.Text = String.Empty;
                    DBNameTextBox.Text = String.Empty;
                    DBUIDTextBox.Text  = String.Empty;
                    DBPwdTextBox.Attributes["value"] = String.Empty;
                    HisDBIPTextBox.Text   = String.Empty;
                    HisDBPortTextBox.Text = String.Empty;
                    HisDBNameTextBox.Text = String.Empty;
                    HisDBUIDTextBox.Text  = String.Empty;
                    HisDBPwdTextBox.Attributes["value"] = String.Empty;
                    EnabledCheckBox.Checked             = false;
                    LscIDTextBox.Enabled = false;
                    TitleLabel.Text      = "编辑记录";
                    UpdateBtn.Visible    = true;
                    SaveBtn.Visible      = false;
                    var lsc = lscEntity.GetLsc(lscId);
                    if (lsc != null)
                    {
                        LscIDTextBox.Text   = lsc.LscID.ToString();
                        LscNameTextBox.Text = lsc.LscName;
                        LscIPTextBox.Text   = lsc.LscIP;
                        LscPortTextBox.Text = lsc.LscPort.ToString();
                        LscUIDTextBox.Text  = lsc.LscUID;
                        LscPwdTextBox.Attributes["value"] = lsc.LscPwd;
                        BeatIntervalTextBox.Text          = lsc.BeatInterval.ToString();
                        BeatDelayTextBox.Text             = lsc.BeatDelay.ToString();
                        DBIPTextBox.Text   = lsc.DBServer;
                        DBPortTextBox.Text = lsc.DBPort.ToString();
                        DBNameTextBox.Text = lsc.DBName;
                        DBUIDTextBox.Text  = lsc.DBUID;
                        DBPwdTextBox.Attributes["value"] = lsc.DBPwd;
                        HisDBIPTextBox.Text   = lsc.HisDBServer;
                        HisDBPortTextBox.Text = lsc.HisDBPort.ToString();
                        HisDBNameTextBox.Text = lsc.HisDBName;
                        HisDBUIDTextBox.Text  = lsc.HisDBUID;
                        HisDBPwdTextBox.Attributes["value"] = lsc.HisDBPwd;
                        EnabledCheckBox.Checked             = lsc.Enabled;
                    }
                    ModalPopupExtender.Show();
                    break;

                case "Del":
                    lscEntity.DelLsc(lscId);
                    var lscs = lscEntity.GetLscs();
                    gvLsc.DataSource    = lscs;
                    gvLsc.SelectedIndex = -1;
                    gvLsc.DataBind();
                    break;

                default:
                    break;
                }
            } catch (Exception err) { handleError(err.Message); }
        }