Exemplo n.º 1
0
 /// <summary>
 /// GetEnergyLabel_Family
 /// </summary>
 /// <returns></returns>
 public IList<string> GetEnergyLabel_Family()
 {
     try
     {
         IList<string> retList = new List<string>();
         EnergyLabelInfo condition = new EnergyLabelInfo();
         IList<EnergyLabelInfo> tempEngList = new List<EnergyLabelInfo>();
         tempEngList = iMiscRepository.GetEnergyLabel(condition);
         retList = (from q in tempEngList
                    select q.family).Distinct().OrderBy(q => q).ToList<string>();
         return retList;
     }
     catch (Exception)
     {
         throw;
     } 
 }
Exemplo n.º 2
0
    protected void btnDelete_ServerClick(Object sender, EventArgs e)
    {
        int ID = Convert.ToInt32(this.hidID.Value);
        try
        {
            EnergyLabelInfo item = new EnergyLabelInfo();
            item.id = ID;
            iEnergyLabel.DeleteEnergyLabel(ID);
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            //show error
            showErrorMessage(ex.Message);
            return;
        }

        ShowListByType();
        //ShowTypeDescriptionByType();
        this.updatePanel2.Update();
        ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "DeleteComplete();DealHideWait();", true);
    }
Exemplo n.º 3
0
    protected void btnSave_ServerClick(Object sender, EventArgs e)
    {
        EnergyLabelInfo item = new EnergyLabelInfo();
        string userName = this.HiddenUserName.Value;
        item.family = this.cmbEnergyLabelFamilyList.SelectedValue;
        item.chinaLevel = this.cmbChinaLevel.SelectedValue;
        item.level = this.txtLevel.Text.Trim();
        item.seriesName = this.txtSeriesName.Text.Trim();
        item.saveEnergy = this.txtSaveEnergy.Text.Trim();
        item.editor = this.hidTbUser.Value;
        //item.cdt = DateTime.Now;
        //item.udt = DateTime.Now;
        try
        {
            iEnergyLabel.addeditEnergyLabel(item,userName);
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            //show error
            showErrorMessage(ex.Message);
            return;
        }

        ShowListByType();
        //ShowTypeDescriptionByType();              
        //String itemId = replaceSpecialChart("");
        string family = item.family;
        this.updatePanel2.Update();
        ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "AddUpdateComplete('" + family + "');DealHideWait();", true);
    }
Exemplo n.º 4
0
    private Boolean ShowListByType()
    {
        String type = selecttype.Value;
        type2 = this.cmbEnergyLabelFamilyListTop.SelectedItem.Value;
        try
        {
            EnergyLabelInfo condition = new EnergyLabelInfo();

            if (type2 != "ALL")
            {
                condition.family = type2;
            }


            IList<EnergyLabelInfo> energyLabelList = iEnergyLabel.GetEnergyLabelByCondition(condition);

            if (energyLabelList == null || energyLabelList.Count == 0)
            {
                bindTable(null, DEFAULT_ROWS);
            }
            else
            {
                bindTable(energyLabelList, DEFAULT_ROWS);
            }
        }
        catch (FisException ex)
        {
            bindTable(null, DEFAULT_ROWS);
            showErrorMessage(ex.mErrmsg);
            return false;
        }
        catch (Exception ex)
        {
            //show error
            bindTable(null, DEFAULT_ROWS);
            showErrorMessage(ex.Message);
            return false;
        }

        return true;

    }
Exemplo n.º 5
0
 /// <summary>
 /// addeditEnergyLabel
 /// </summary>
 /// <param name="condition">EnergyLabelInfo</param>
 public void addeditEnergyLabel(EnergyLabelInfo condition, string userName)
 {
     try
     {
         IList<EnergyLabelInfo> checkdata = new List<EnergyLabelInfo>();
         EnergyLabelInfo checkCondition = new EnergyLabelInfo();
         checkCondition.family = condition.family;
         checkCondition.chinaLevel = condition.chinaLevel;
         checkdata = iMiscRepository.GetEnergyLabel(checkCondition);//family, china label
         condition.udt = DateTime.Now;
         condition.cdt = DateTime.Now;
         condition.editor = userName;
         if (checkdata.Count == 0)
         {
             iMiscRepository.InsertEnergyLabel(condition);
         }
         else
         {
             condition.id = checkdata[0].id;
             iMiscRepository.UpdateEnergyLabel(condition);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// GetEnergyLabelByCondition
 /// </summary>
 /// <param name="condition">EnergyLabelInfo</param>
 /// <returns></returns>
 public IList<EnergyLabelInfo> GetEnergyLabelByCondition(EnergyLabelInfo condition)
 {
     try
     {
         IList<EnergyLabelInfo> retLst = new List<EnergyLabelInfo>();
         retLst = iMiscRepository.GetEnergyLabel(condition);
         return retLst;
     }
     catch (Exception)
     {
         throw;
     }                       
 }