Ejemplo n.º 1
0
    protected void btnAdd_ServerClick(object sender, EventArgs e)
    {
        LightStDef def = new LightStDef();
        def.family = this.ddlFamily.InnerDropDownList.SelectedValue.Trim();
        def.iecpn = this.ttIECPN.Text.Trim();
        def.sation = this.ddlLightStation.InnerDropDownList.SelectedValue.Trim();
        def.editor = this.HiddenUserName.Value;

        System.DateTime cdt = DateTime.Now; ;
        string timeStr = cdt.ToString("yyyy-MM-dd hh:mm:ss");
        def.cdt = timeStr;
        string id = "";
        try
        {

            //调用添加的方法 相同的key时需要抛出异常...
            id = iter.AddLightStationItem(def).ToString();
        }
        catch (FisException fex)
        {

            showErrorMessage(fex.mErrmsg);
            return;
        }
        catch (System.Exception ex)
        {

            showErrorMessage(ex.Message);
            return;
        }
        //按照ac adaptor list加载表格中的数据
        //...
        showListByACAdaptorList();
        this.updatePanel2.Update();
        //    string assemblyId = replaceSpecialChart(adaptor.assemb);
        ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "saveUpdate", "resetTableHeight();AddUpdateComplete('" + id + "');HideWait();", true);
    }
Ejemplo n.º 2
0
    protected void btnSave_ServerClick(object sender, EventArgs e)
    {
        LightStDef def = new LightStDef();
        def.family = this.ddlFamily.InnerDropDownList.SelectedValue.Trim();
        def.sation = this.ddlLightStation.InnerDropDownList.SelectedValue.Trim();
        def.iecpn = this.ttIECPN.Text.Trim();

        def.editor = this.HiddenUserName.Value.Trim();
        def.id = Convert.ToInt32(this.dOldId.Value.Trim());
        string id = this.dOldId.Value.Trim();
        try
        {
            //调用更新方法1... 相同key时需要抛出异常...
            iter.UpdateLightStationItem(def, Convert.ToInt32(id));
        }
        catch (FisException fex)
        {
            showErrorMessage(fex.mErrmsg);
            return;
        }
        catch (System.Exception ex)
        {
            showErrorMessage(ex.Message);
            return;
        }
        showListByACAdaptorList();
        this.updatePanel2.Update();
        ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "saveUpdate", "resetTableHeight();AddUpdateComplete('" + id + "');HideWait();", true);
    }
Ejemplo n.º 3
0
 private static void VO2PO(IList<FaPaLightstInfo> voList, IList<LightStDef> datalst)
 {
     if (voList != null)
     {
         foreach (FaPaLightstInfo info in voList)
         {
             LightStDef def = new LightStDef();
             def.id = info.id;
             def.iecpn = info.pno;
             def.family = info.family;
             def.sation = info.stn;
             def.editor = info.editor;
             def.cdt = info.cdt.ToString("yyyy-MM-dd hh:mm:ss");
             def.udt = info.udt.ToString("yyyy-MM-dd hh:mm:ss");
             datalst.Add(def);
         }
     }
 }