Exemplo n.º 1
0
 /// <summary>
 /// GetIndonesiaLabelByCondition
 /// </summary>
 /// <param name="condition">IndonesiaLabelInfo</param>
 /// <returns></returns>
 public IList<IndonesiaLabelInfo> GetIndonesiaLabelByCondition(IndonesiaLabelInfo condition)
 {
     try
     {
         IList<IndonesiaLabelInfo> retLst = new List<IndonesiaLabelInfo>();
         retLst = iMiscRepository.GetIndonesiaLabel(condition);
         return retLst;
     }
     catch (Exception)
     {
         throw;
     }                       
 }
Exemplo n.º 2
0
 /// <summary>
 /// GetIndornesiaLabel_Family
 /// </summary>
 /// <returns></returns>
 public IList<string> GetIndornesiaLabel_Family()
 {
     try
     {
         IList<string> retList = new List<string>();
         IndonesiaLabelInfo condition = new IndonesiaLabelInfo();
         IList<IndonesiaLabelInfo> tempList = new List<IndonesiaLabelInfo>();
         tempList = iMiscRepository.GetIndonesiaLabel(condition);
         retList = (from q in tempList
                    select q.family).Distinct().OrderBy(q => q).ToList<string>();
         return retList;
     }
     catch (Exception)
     {
         throw;
     } 
 }
Exemplo n.º 3
0
 /// <summary>
 /// addeditIndonesiaLabel
 /// </summary>
 /// <param name="condition">IndonesiaLabelInfo</param>
 /// <param name="userName">string</param>
 public void addeditIndonesiaLabel(IndonesiaLabelInfo condition,string userName)
 {
     try
     {
         IList<IndonesiaLabelInfo> checkdata = new List<IndonesiaLabelInfo>();
         IndonesiaLabelInfo checkCondition = new IndonesiaLabelInfo();
         checkCondition.sku = condition.sku;
         checkdata = iMiscRepository.GetIndonesiaLabel(checkCondition);
         condition.udt = DateTime.Now;
         condition.cdt = DateTime.Now;
         condition.editor = userName;
         if (checkdata.Count == 0)
         {
             iMiscRepository.InsertIndonesiaLabel(condition);
         }
         else
         {
             condition.id = checkdata[0].id;
             iMiscRepository.UpdateIndonesiaLabel(condition);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 4
0
    protected void btnSave_ServerClick(Object sender, EventArgs e)
    {
        IndonesiaLabelInfo item = new IndonesiaLabelInfo();
        string userName = this.HiddenUserName.Value;
        item.family = this.cmbIndornesiaLabelFamilyList.SelectedValue;
        item.sku = this.txtSKU.Text.Trim();
        item.descr = this.txtDescr.Text.Trim();
        item.approvalNo = this.txtApprovalNo.Text.Trim();
        item.editor = this.hidTbUser.Value;

        try
        {
            iIndornesiaLabel.addeditIndonesiaLabel(item,userName);
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            //show error
            showErrorMessage(ex.Message);
            return;
        }

        ShowListByType();
        string family = item.family;
        this.updatePanel2.Update();
        ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "AddUpdateComplete('" + family + "');DealHideWait();", true);
    }
Exemplo n.º 5
0
    private Boolean ShowListByType()
    {
        String type = selecttype.Value;
        type2 = this.cmbIndornesiaLabelFamilyListTop.SelectedItem.Value;
        string sku = this.txtSKUTop.Text.Trim();
        try
        {
            IndonesiaLabelInfo condition = new IndonesiaLabelInfo();

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

            IList<IndonesiaLabelInfo> energyLabelList = iIndornesiaLabel.GetIndonesiaLabelByCondition(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;

    }