protected void btnSave_Click(Object sender, EventArgs e)
    {
        string name = hidattrname.Value.Trim();
        string value = txtattrvalue.Text.Trim(); ;
        string descr = txtdesce.Text.Trim();
        StationAttrDef StationDef = new StationAttrDef();
        //FamilyInfoDef model = new FamilyInfoDef();
        StationDef.Station = strStationName;
        StationDef.AttrName = name;
        StationDef.AttrValue = value;
        StationDef.Descr = descr;
        StationDef.Editor = editor;
        

        try
        {

            String Check = iStation.GetStationAttrValue(strStationName, name);
            if (Check == "" || Check == null)
            {
                iStation.AddStationAttr(StationDef);
            }
            else
            {
                iStation.UpdateStationAttr(StationDef);
            }

        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;

        }
        catch (Exception ex)
        {
            showErrorMessage(ex.Message);
            return;
        }

        bindTable();
        ScriptManager.RegisterStartupScript(this.updatePanel3, typeof(System.Object), "SaveComplete", "SaveComplete(\"" + "-1" + "\");", true);
    }
Exemple #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="StationAttrDef"></param>
 /// <returns></returns>
 public void UpdateStationAttr(StationAttrDef attr)
 {
     try
     {
         itemRepository.UpdateStationAttr(attr);
     }
     catch (Exception)
     {
         throw;
     }
 }