Ejemplo n.º 1
0
    public Int64 GetValueFindByText(string Text)
    {
        MerchantModel _model = new MerchantModel();
        Merchant      p      = _model.FindMerchant(Text);

        ////var p = ddlMercharList.Items.FindByText
        ////    (from m in ddlMercharList.Items.AsQueryable()
        ////         where m.MerchantNameDetail.Equals(searchText)
        ////         select m.MID).SingleOrDefault();
        //string p = ddlMercharList.Items.FindByText(searchText).Value.ToString();
        if (p.MID != 0)
        {
            return(Convert.ToInt64(p.MID));//ddlMercharList.Items.FindByText(searchText).Value);
        }
        else
        {
            return(0);
        }
        //MerchantModel obj = new MerchantModel();

        //var mid = (from m in obj.GetAllMerchants()
        //          where m.MerchantNameDetail == Text
        //          select m.MID).SingleOrDefault();

        //return 0;
    }
Ejemplo n.º 2
0
 private void LoadViewFromModel()
 {
     if (string.IsNullOrEmpty(_view.MerchantName))
     {
         _view.Merchants = _model.GetAllMerchants();
     }
     else
     {
         List <Merchant> items = new List <Merchant>();
         items.Add(_model.FindMerchant(_view.MerchantName));
         _view.Merchants = items;
     }
 }
Ejemplo n.º 3
0
    //public int GetMIDByOMGID(string omgMID)
    //{
    //    MerchantModel _model = new MerchantModel();
    //    Merchant p = _model.GetAllMerchants().Where(w => w.OMGMID == Convert.ToInt32(omgMID)).FirstOrDefault();

    //    ////var p = ddlMercharList.Items.FindByText
    //    ////    (from m in ddlMercharList.Items.AsQueryable()
    //    ////         where m.MerchantNameDetail.Equals(searchText)
    //    ////         select m.MID).SingleOrDefault();
    //    //string p = ddlMercharList.Items.FindByText(searchText).Value.ToString();
    //    if (p.MID != 0)
    //        return Convert.ToInt32(p.MID);//ddlMercharList.Items.FindByText(searchText).Value);
    //    else
    //        return 0;
    //    //MerchantModel obj = new MerchantModel();

    //    //var mid = (from m in obj.GetAllMerchants()
    //    //          where m.MerchantNameDetail == Text
    //    //          select m.MID).SingleOrDefault();

    //    //return 0;

    //}



    public string LiveMID(string Text)
    {
        MerchantModel _model = new MerchantModel();
        Merchant      p      = _model.FindMerchant(Text);

        ////var p = ddlMercharList.Items.FindByText
        ////    (from m in ddlMercharList.Items.AsQueryable()
        ////         where m.MerchantNameDetail.Equals(searchText)
        ////         select m.MID).SingleOrDefault();
        //string p = ddlMercharList.Items.FindByText(searchText).Value.ToString();
        if (p.OMGMID != 0)
        {
            return(p.OMGMID.ToString());//ddlMercharList.Items.FindByText(searchText).Value);
        }
        else
        {
            return("");
        }
    }