Exemplo n.º 1
0
 /// <summary>
 /// 案場修改
 /// </summary>
 /// <param name="setting"></param>
 public void Update_CaseSetting(CaseSetting setting)
 {
     try
     {
         using (var Conn = new MySqlConnection(scsb.ConnectionString))
         {
             string sql = "UPDATE casesetting SET " +
                          "Address = @Address, " +
                          "Contacter = @Contacter," +
                          "Phone = @Phone," +
                          "TitleName = @TitleName," +
                          "NotifyTypeEnum = @NotifyTypeEnum," +
                          "NotifyApi = @NotifyApi," +
                          "NotifyToken = @NotifyToken," +
                          "Longitude = @Longitude," +
                          "Latitude = @Latitude" +
                          " WHERE CaseNo = @CaseNo AND AiNo = @AiNo";
             Conn.Execute(sql, setting);
         }
     }
     catch (Exception ex)
     {
         Log.Error(ex, "案場修改" + "錯誤(Ewatch)");
     }
 }
        /// <summary>
        /// AI資訊
        /// </summary>
        /// <returns></returns>
        public List <AiSetting> AiLoad(CaseSetting casesetting)
        {
            List <AiSetting> setting = null;

            using (var Conn = new MySqlConnection(scsb.ConnectionString))
            {
                string sql = "SELECT * FROM AiSetting Where CaseNo = @CaseNo";
                setting = Conn.Query <AiSetting>(sql, new { CaseNo = casesetting.CaseNo }).ToList();
            }
            return(setting);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 案場新增
 /// </summary>
 /// <param name="setting"></param>
 public void Insert_CaseSetting(CaseSetting setting)
 {
     try
     {
         using (var Conn = new MySqlConnection(scsb.ConnectionString))
         {
             string sql = "INSERT IGNORE INTO casesetting (CaseNo,Address,Contacter,Phone,TitleName,NotifyTypeEnum,NotifyApi,NotifyToken,Longitude,Latitude)" +
                          " VALUES(@CaseNo,@Address,@Contacter,@Phone,@TitleName,@NotifyTypeEnum,@NotifyApi,@NotifyToken,@Longitude,@Latitude) ";
             Conn.Execute(sql, setting);
         }
     }
     catch (Exception ex)
     {
         Log.Error(ex, "案場新增" + "錯誤(Ewatch)");
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 電表資訊查詢案場
        /// </summary>
        /// <returns></returns>
        public List <ElectricSetting> ElectricLoad(CaseSetting casesetting)
        {
            List <ElectricSetting> setting = null;

            try
            {
                using (var Conn = new MySqlConnection(scsb.ConnectionString))
                {
                    string sql = "SELECT * FROM ElectricSetting Where CaseNo = @CaseNo";
                    setting = Conn.Query <ElectricSetting>(sql, new { CaseNo = casesetting.CaseNo }).ToList();
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "電表資訊查詢案場" + "錯誤(Ewatch)");
            }
            return(setting);
        }
        /// <summary>
        /// Receive資訊查案場
        /// </summary>
        /// <param name="caseSetting"></param>
        /// <returns></returns>
        public List <ReceiveSetting> ReceiveLoad(CaseSetting casesetting)
        {
            List <ReceiveSetting> setting = null;

            try
            {
                using (var Conn = new MySqlConnection(scsb.ConnectionString))
                {
                    string sql = "SELECT * FROM ReceiveSetting Where CaseNo = @CaseNo";
                    setting = Conn.Query <ReceiveSetting>(sql, new { CaseNo = casesetting.CaseNo }).ToList();
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Receive資訊查案場" + "錯誤(ChungHsin)");
            }
            return(setting);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 修改按鈕
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ChangesimpleButton_Click(object sender, EventArgs e)
        {
            CaseSetting caseSetting = new CaseSetting()
            {
                CaseNo         = CaseNotextEdit.Text,
                Address        = AddresstextEdit.Text,
                Contacter      = ContactertextEdit.Text,
                Phone          = PhonetextEdit.Text,
                TitleName      = TitleNametextEdit.Text,
                NotifyTypeEnum = NotifyTypeEnumcomboBoxEdit.SelectedIndex,
                NotifyApi      = NotifyApitextEdit.Text,
                NotifyToken    = NotifyTokentextEdit.Text,
                Longitude      = Convert.ToSingle(LongitudetextEdit.Text),
                Latitude       = Convert.ToSingle(LatitudetextEdit.Text)
            };

            Ewatch_MySqlMethod.Update_CaseSetting(caseSetting);
            Search_Setting();
        }
        private void SavesimpleButton_Click(object sender, EventArgs e)
        {
            CaseSetting caseSetting = new CaseSetting()
            {
                CaseNo         = CaseNotextEdit.Text,
                Address        = AddresstextEdit.Text,
                Contacter      = ContactertextEdit.Text,
                Phone          = PhonetextEdit.Text,
                TitleName      = TitleNametextEdit.Text,
                NotifyTypeEnum = NotifyTypeEnumcomboBoxEdit.SelectedIndex,
                NotifyApi      = NotifyApitextEdit.Text,
                NotifyToken    = NotifyTokentextEdit.Text,
                Longitude      = Convert.ToSingle(LongitudetextEdit.Text),
                Latitude       = Convert.ToSingle(LatitudetextEdit.Text)
            };

            ChungHsin_MySqlMethod.Insert_CaseSetting(caseSetting);
            caseUserControl.Search_Setting();
            caseUserControl.FlyoutFlag = false;
            caseUserControl.flyout.Close();
        }