Ejemplo n.º 1
0
 public void AgregarListaItem(List <OOB.LibCompra.Documento.Pendiente.Abrir.FichaDetalle> list, string idPrv, decimal factorDivisa)
 {
     foreach (var it in list)
     {
         var item = new dataItem(it, factorDivisa);
         InsertarItem(item);
     }
 }
 public void CargarItems(List <OOB.LibCompra.Documento.GetData.FichaDetalle> list, decimal factorCambio)
 {
     foreach (var it in list)
     {
         var dt = new dataItem(it, factorCambio);
         InsertarItem(dt);
     }
 }
        public void Editar(dataItem it)
        {
            SalidaOk = false;
            RegistroOk = false;

            item = new dataItem(it);
            var frm = new Formulario.ItemFrm();
            frm.setControlador(this);
            frm.ShowDialog();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 设置当前登陆用户的信息
 /// </summary>
 public void setUserInfo()
 {
     if (data.Count > 0)
     {
         dataItem item = data[0];
         Global.user.Xm         = item.xm;
         Global.user.Department = item.jgqc;
         Global.user.Phone      = item.sjhm;
         Global.user.Email      = item.dzyx;
     }
 }
Ejemplo n.º 5
0
        // #Agreements Breakdown by Service Type
        protected PieCharts GetPieChartNoAgreementByServiceType(IList <ChildAgreements> listChildAgreements) // query from database and return charts object
        {
            Dictionary <string, string> DictPlacementCategory = GetDictServiceType();

            var ePieCharts = new PieCharts();

            ePieCharts.SetDefault(false);
            ePieCharts.title.text = "Number of Agreement breakdown by Service Type";

            ePieCharts.series = new List <ACCDataStore.Entity.RenderObject.Charts.PieCharts.series>();
            if (listChildAgreements != null && listChildAgreements.Count > 0)
            {
                var listResults = listChildAgreements.GroupBy(x => x.Service_Type).Select(r => new
                {
                    Client_id = r.First().Service_Type,
                    Count     = r.Count().ToString(),
                    Cost      = r.Sum(xl => xl.actual_cost).ToString()
                }).OrderByDescending(x => x.Cost).ToList();


                List <dataItem> listdata = new List <dataItem>()
                {
                };

                foreach (var temp in listResults)
                {
                    dataItem dataItem = new dataItem();
                    dataItem.name   = DictPlacementCategory[temp.Client_id];
                    dataItem.y      = (float?)Convert.ToDouble(temp.Count);
                    dataItem.sliced = true;
                    listdata.Add(dataItem);
                }

                ePieCharts.series.Add(new ACCDataStore.Entity.RenderObject.Charts.PieCharts.series()
                {
                    name         = listChildAgreements[0].client_id,
                    data         = listdata,
                    colorByPoint = true
                });
            }

            ePieCharts.exporting = new ACCDataStore.Entity.RenderObject.Charts.Generic.exporting()
            {
                enabled  = true,
                filename = "export"
            };

            //ePieCharts.chart.options3d = new Entity.RenderObject.Charts.Generic.options3d() { enabled = true, alpha = 10, beta = 10 }; // enable 3d charts

            return(ePieCharts);
        }
Ejemplo n.º 6
0
 private void InsertarItem(dataItem item)
 {
     bl.Add(item);
     bs.CurrencyManager.Refresh();
 }
Ejemplo n.º 7
0
 public HistoryResponse()
 {
     data = new dataItem();
 }
Ejemplo n.º 8
0
 public SetListResponse()
 {
     data = new dataItem();
 }
Ejemplo n.º 9
0
 public SearchResponse()
 {
     data = new dataItem();
 }
Ejemplo n.º 10
0
 public BookNodeCIdResponse()
 {
     data = new dataItem();
 }
Ejemplo n.º 11
0
 public NodeDetailResponse()
 {
     data = new dataItem();
 }
Ejemplo n.º 12
0
 public AllBooksResponse()
 {
     data = new dataItem();
 }
Ejemplo n.º 13
0
 public OpinionResponse()
 {
     data = new dataItem();
 }
Ejemplo n.º 14
0
        public async Task <ActionResult> PaymentMoMoServer(dataItem item)
        {
            var refId     = Guid.NewGuid();
            var requestId = Guid.NewGuid();
            var model     = new HashMoMoItem
            {
                amount       = item.amount ?? 0,
                partnerRefId = refId.ToString(),
                partnerCode  = PartnerCode,
                //partnerName = "Công ty cổ phần công nghệ G-store",
                partnerTransId = DateTime.Now.TotalSeconds().ToString(),
                description    = item.description ?? "",
            };
            var json = new JavaScriptSerializer().Serialize(model);

            byte[] data   = Encoding.UTF8.GetBytes(json);
            string result = null;

            using (var rsa = new RSACryptoServiceProvider(4096)) //KeySize
            {
                try
                {
                    // MoMo's public key has format PEM.
                    // You must convert it to XML format. Recommend tool: https://superdry.apphb.com/tools/online-rsa-key-converter
                    rsa.FromXmlString(publickey);
                    var encryptedData   = rsa.Encrypt(data, false);
                    var base64Encrypted = Convert.ToBase64String(encryptedData);
                    result = base64Encrypted;
                }
                finally
                {
                    rsa.PersistKeyInCsp = false;
                }
            }
            var data1 = new ProcessMoMoItem
            {
                customerNumber = item.customerNumber ?? "",
                partnerCode    = PartnerCode,
                partnerRefId   = refId.ToString(),
                appData        = item.token ?? "",
                hash           = result,
                payType        = 3,
                description    = item.description ?? "",
                version        = 2
            };
            var                      url = Momo + "pay/app";
            ResultMoMoItem           kq;
            ResultDataMoMoAppIG4Item resutl;

            new ResultDataMoMoAppIG4Item();
            try
            {
                kq = await PostDataAsync <ResultMoMoItem>(url, data1);

                var requestType = "";
                var obj         = new ConfirmMoMoItem();
                if (kq.status == 0)
                {
                    obj.requestType = "capture";
                    requestType     = "capture";
                }
                else
                {
                    obj.requestType = "revertAuthorize";
                    requestType     = "revertAuthorize";
                }
                var    sign      = string.Format("partnerCode={0}&partnerRefId={1}&requestType={2}&requestId={3}&momoTransId={4}", PartnerCode, refId.ToString(), requestType, requestId.ToString(), kq.transid);
                string signature = signSHA256(sign, serectkey);
                obj.partnerCode    = PartnerCode;
                obj.partnerRefId   = refId.ToString();
                obj.customerNumber = item.customerNumber;
                obj.description    = item.description;
                obj.momoTransId    = kq.transid;
                obj.requestId      = requestId.ToString();
                obj.signature      = signature;
                var urlconfirm = Momo + "pay/confirm";
                try
                {
                    resutl = await PostDataAsync <ResultDataMoMoAppIG4Item>(urlconfirm, obj);

                    if (resutl.status == 0)
                    {
                        // thêm tiền vào ví chính
                        var wallet = new WalletCustomer
                        {
                            //Price = (decimal)resutl.data.amount,
                            TotalPrice     = (decimal)resutl.data.amount,
                            CustomerID     = item.CustomerId,
                            DateCreate     = DateTime.Now.TotalSeconds(),
                            IsDelete       = false,
                            IsActive       = true,
                            Note           = item.description,
                            Transaction_no = resutl.transid,
                            Type           = 1,
                        };
                        _walletCustomerDa.Add(wallet);
                        _walletCustomerDa.Save();
                        var gettoken = _customerDa.GetItemByID(item.CustomerId);
                        // % khuyến mãi vào ví thưởng.
                        var config = _walletCustomerDa.GetConfig();
                        var reward = new RewardHistory
                        {
                            CustomerID  = item.CustomerId,
                            Price       = config.Percent * ((decimal)resutl.data.amount) / 100,
                            IsActive    = true,
                            IsDeleted   = false,
                            Date        = DateTime.Now.TotalSeconds(),
                            WalletCusId = wallet.ID,
                            Type        = (int)Reward.Dep,
                            Percent     = config.Percent,
                        };
                        _rewardHistoryDa.Add(reward);
                        _rewardHistoryDa.Save();
                        var sucess = orderDA.GetNotifyById(4);
                        var token  = gettoken.tokenDevice;
                        Pushnotifycation(sucess.Title.Replace("{percent}", config.Percent.ToString()), sucess.Content.Replace("{price}", reward.Price.Money()).Replace("{total}", resutl.data.amount.MoneyDouble()), token, sucess.ID.ToString());
                    }
                    return(Json(resutl, JsonRequestBehavior.AllowGet));
                }
                catch (Exception ex)
                {
                    resutl = new ResultDataMoMoAppIG4Item
                    {
                        status  = -1,
                        message = ex.ToString()
                    };
                    return(Json(resutl, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                resutl = new ResultDataMoMoAppIG4Item
                {
                    status  = -1,
                    message = ex.ToString()
                };
                return(Json(resutl, JsonRequestBehavior.AllowGet));
            }
        }
 public void NuevoItem()
 {
     item          = new dataItem();
     autoPrd       = "";
     autoProveedor = "";
 }
Ejemplo n.º 16
0
        /// <summary>
        /// 获取文件的类型出入次数
        /// </summary>
        /// <param name="ObsFile"></param>
        /// <returns></returns>
        public static Dictionary <SatelliteType, SatObsTypeMarker> GetSatObsTypeMarkers(ref RinexObsFile ObsFile)
        {
            Dictionary <SatelliteType, SatObsTypeMarker> markers = new Dictionary <SatelliteType, SatObsTypeMarker>();



            List <Geo.Times.Time> ss = new List <Geo.Times.Time>();

            //存储待删除的时段的起始与结束历元标记,多个时段
            Dictionary <SatelliteNumber, List <Geo.Times.Time> > data = new Dictionary <SatelliteNumber, List <Geo.Times.Time> >();

            //记录一个时段的观测历元信息
            Dictionary <SatelliteNumber, List <dataItem> > data0 = new Dictionary <SatelliteNumber, List <dataItem> >();



            foreach (var obsSection in ObsFile)
            {
                //只记录观测值,不管卫星编号
                foreach (var obsData in obsSection)
                {
                    //第一次出现
                    if (!data0.ContainsKey(obsData.Prn))
                    {
                        if (!data.ContainsKey(obsData.Prn))
                        {
                            data.Add(obsData.Prn, new List <Geo.Times.Time>());
                        }
                        // satData[obsData.Prn].Add(obsSection.Time);


                        data0.Add(obsData.Prn, new List <dataItem>());
                        dataItem pair = new dataItem(obsSection.ReceiverTime, 0, obsData.Prn);

                        data0[obsData.Prn].Add(pair);
                        data0[obsData.Prn][0].lastGpsTime = obsSection.ReceiverTime;
                        data0[obsData.Prn][0].Count      += 1;
                        data0[obsData.Prn][0].TimeList.Add(obsSection.ReceiverTime);
                        continue;
                    }


                    if (Math.Abs(obsSection.ReceiverTime - data0[obsData.Prn][0].lastGpsTime) <= 31)
                    {
                        data0[obsData.Prn][0].Count += 1;
                        data0[obsData.Prn][0].TimeList.Add(obsSection.ReceiverTime);

                        data0[obsData.Prn][0].lastGpsTime = obsSection.ReceiverTime;
                    }
                    else
                    {
                        //判断这个时段内观测的数据是否超过40分钟,否则要删除
                        if (data0[obsData.Prn][0].Count < 80)
                        {
                            data[obsData.Prn].Add(data0[obsData.Prn][0].beginGpsTime); //删除该时段的开始标记

                            data[obsData.Prn].Add(data0[obsData.Prn][0].lastGpsTime);  //删除该时段的结束标记
                        }

                        data0.Remove(obsData.Prn); //移除,重新开始

                        //再次添加新的时段
                        if (!data0.ContainsKey(obsData.Prn))
                        {
                            data0.Add(obsData.Prn, new List <dataItem>());
                            dataItem pair = new dataItem(obsSection.ReceiverTime, 0, obsData.Prn);

                            data0[obsData.Prn].Add(pair);
                            data0[obsData.Prn][0].lastGpsTime = obsSection.ReceiverTime;
                            data0[obsData.Prn][0].Count      += 1;
                            data0[obsData.Prn][0].TimeList.Add(obsSection.ReceiverTime);
                        }
                    }



                    //某一特定类型卫星
                    var satType = obsData.Prn.SatelliteType;
                    if (!markers.ContainsKey(satType))
                    {
                        markers[satType] = new SatObsTypeMarker();
                    }

                    var sateObsMarker = markers[satType];
                    //该卫星的所有观测量
                    foreach (var type in obsData)
                    {
                        if (obsData.TryGetValue(type.Key) != 0)
                        {
                            sateObsMarker.Markes(type.Key);
                        }
                        else if (!sateObsMarker.Contains(type.Key)) //查看是否具有记录,如果没有,就标记为 0 。
                        {
                            sateObsMarker.SetObsTypeCount(type.Key, 0);
                        }
                    }
                }
            }

            //最后一个时段是否也满足弧长段
            foreach (var item in data0)
            {
                if (item.Value[0].Count < 80)
                {
                    data[item.Value[0].Prn].Add(item.Value[0].beginGpsTime); //删除该时段的开始标记

                    data[item.Value[0].Prn].Add(item.Value[0].lastGpsTime);  //删除该时段的结束标记
                }
            }



            List <string> list = new List <string>();

            foreach (var marker in markers)
            {
                foreach (var type in marker.Value)
                {
                    list.Add(type);
                }
            }

            foreach (var obsSection in ObsFile)
            {
                //只记录观测值,不管卫星编号
                foreach (var obsData in obsSection)
                {
                    if (data.ContainsKey(obsData.Prn))
                    {
                        if (data[obsData.Prn].Count > 0)
                        {
                            //
                            for (int i = 0; i < data[obsData.Prn].Count / 2; i++)
                            {
                                //
                                if (data[obsData.Prn][i * 2] <= obsSection.ReceiverTime && obsSection.ReceiverTime <= data[obsData.Prn][i * 2 + 1])
                                {
                                    //
                                    obsSection[obsData.Prn].Remove(list);
                                }
                            }
                        }
                    }
                }
            }



            return(markers);
        }
Ejemplo n.º 17
0
 public BookContentResponse()
 {
     data = new dataItem();
 }