Пример #1
0
        //public ActionResult Common170_Search(doCMS170_SearchInstrument Search)
        //{
        //    ObjectResultData res = new ObjectResultData();
        //    List<MessageModel> msgLst = new List<MessageModel>();
        //    string InstruCode = Search.InstumentCode;

        //    if( InstruCode == "")
        //        InstruCode = "%";
        //    string InstruName = Search.InstumentName;

        //    if (InstruName == "")
        //        InstruName = "%";

        //    string Maker = Search.Maker;

        //    if (Maker == "")
        //        Maker = "%";

        //    string InstruType1 = Search.InstrumentType_1;
        //    string InstruType2 = Search.InstrumentType_2;
        //    string InstruType3 = Search.InstrumentType_3;
        //    string InstrumentFlag_1 = Search.InstrumentFlag_1;
        //    string InstrumentFlag_2 = Search.InstrumentFlag_2;
        //    string ExpantionType_1 = Search.ExpantionType_1;
        //    string ExpantionType_2 = Search.ExpantionType_2;
        //    string Sale = Search.ProductType_1;
        //    string Rental = Search.ProductType_2;
        //    if (InstrumentFlag_1 == null && InstrumentFlag_2 == null )
        //    {
        //        res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0079);
        //        return Json(res);
        //    }


        //    if (Sale == null && Rental == null)
        //    {
        //        res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0079);
        //        return Json(res);
        //    }
        //    else
        //    {
        //        if (Sale == "0")
        //            Sale = "1";
        //        if (Sale == null )
        //            Sale = "0";
        //        if (Rental == null)
        //            Rental = "0";
        //    }
        //    if (ExpantionType_1 == null && ExpantionType_2 == null)
        //    {
        //        res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0079);
        //        return Json(res);
        //    }
        //    else
        //    {
        //        if (ExpantionType_1 == null)
        //            ExpantionType_1 = "%";
        //        if (ExpantionType_2 == null)
        //            ExpantionType_2 = "%";
        //    }

        //    if (InstruType1 == null && InstruType2 == null && InstruType3 == null)
        //    {
        //        res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0079);
        //        return Json(res);
        //    }
        //    else
        //    {
        //        if (InstruType1 == null)
        //            InstruType1 = "%";
        //        if (InstruType2 == null)
        //            InstruType2 = "%";
        //        if (InstruType3 == null)
        //            InstruType3 = "%";
        //    }
        //    string LineUp = Search.LineUpType;
        //    string SupplierCode = Search.SupplierType;
        //    if (SupplierCode == "")
        //        SupplierCode = null;
        //    if (LineUp == "")
        //        LineUp = null;
        //    try
        //    {
        //           IInstrumentMasterHandler hand = ServiceContainer.GetService<IInstrumentMasterHandler>() as IInstrumentMasterHandler;
        //           doInstrumentSearchCondition con = new doInstrumentSearchCondition();
        //           con.InstrumentType = new List<string>(){InstruType1, InstruType2, InstruType3};
        //           int InstrumantFalg1 = Convert.ToInt32(InstrumentFlag_1);
        //           int InstrumantFalg2 = Convert.ToInt32(InstrumentFlag_2);
        //           con.InstrumentFlag = new List<int?>() { InstrumantFalg1, InstrumantFalg2 };
        //           con.InstrumentCode = InstruCode;
        //           con.InstrumentName = InstruName;
        //           con.Maker = Maker;
        //           con.ExpansionType = new List<string>() { ExpantionType_1,ExpantionType_2};
        //           con.SaleFlag = Convert.ToInt32(Sale);
        //           con.RentalFlag = Convert.ToInt32(Rental);
        //           con.SupplierCode = SupplierCode;
        //           con.LineUpTypeCode = LineUp;

        //           List<doInstrumentData> lst = hand.GetInstrumentDataForSearch(con);
        //           if (lst.Count > 0 && lst.Count <= 1000)
        //           {
        //               string xml = CommonUtil.ConvertToXml<doInstrumentData>(lst, "Common\\CMS170");
        //               return Json(xml);
        //           }
        //           else if (lst.Count > 1000)
        //           {
        //               res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0052);
        //               return Json(res);
        //           }
        //           else
        //           {
        //               res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0001);
        //               return Json(res);
        //           }
        //    }
        //    catch(Exception ex)
        //    {
        //        res.AddErrorMessage(ex);
        //        return Json(res);
        //    }

        //   // return null;
        //}
        public ActionResult GetInstrumentName(string cond)
        {
            try
            {
                IAutoCompleteHandler    hand    = ServiceContainer.GetService <IAutoCompleteHandler>() as IAutoCompleteHandler;
                List <doInstrumentName> lst     = hand.GetInstrumentName(cond);
                List <string>           strList = new List <string>();

                foreach (var l in lst)
                {
                    strList.Add(l.InstrumentName);
                }

                return(Json(strList.ToArray()));
            }
            catch (Exception ex)
            {
                ObjectResultData res = new ObjectResultData();
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
Пример #2
0
        public ActionResult MAS090_GetInatrumentName(string cond)
        {
            ObjectResultData res          = new ObjectResultData();
            List <string>    listInstName = new List <string>();

            try
            {
                IAutoCompleteHandler    handler = ServiceContainer.GetService <IAutoCompleteHandler>() as IAutoCompleteHandler;
                List <doInstrumentName> lst     = handler.GetInstrumentName(cond);

                foreach (var item in lst)
                {
                    listInstName.Add(item.InstrumentName);
                }
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            res.ResultData = listInstName.ToArray();
            return(Json(res));
        }