/// <summary>
        ///
        /// </summary>
        /// <param name="fields"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool UpdateInfo(string fields, long id)
        {
            WarehouseLocationInfo info = dal.GetInfo(id);

            if (info == null)
            {
                throw new Exception("MC:0x00000084");///数据错误
            }
            ///仓库
            info.WmNo = CommonBLL.GetFieldValue(fields, "WM_NO");
            WarehouseInfo warehouseInfo = new WarehouseDAL().GetWarehouseInfo(info.WmNo);

            if (warehouseInfo == null)
            {
                throw new Exception("MC:0x00000230");///仓库信息不存在
            }
            ///存储区
            info.ZoneNo = CommonBLL.GetFieldValue(fields, "ZONE_NO");
            ZonesInfo zonesInfo = new ZonesDAL().GetZonesInfo(info.ZoneNo, info.WmNo);

            if (zonesInfo == null)
            {
                throw new Exception("MC:0x00000500");///存储区不存在
            }
            ///库位名称
            info.StorageLocationName = CommonBLL.GetFieldValue(fields, "STORAGE_LOCATION_NAME");
            ///允许存储区代码在不同的仓库中重复使用
            string allow_zoneno_repeat_at_different_warehouse = new ConfigDAL().GetValueByCode("ALLOW_ZONENO_REPEAT_AT_DIFFERENT_WAREHOUSE");
            ///允许库位代码在不同的存储区中重复使用
            string allowDlocRepeatAtDifferentZone = new ConfigDAL().GetValueByCode("ALLOW_DLOC_REPEAT_AT_DIFFERENT_ZONE");

            ///数据校验
            ValidInfo(info, allow_zoneno_repeat_at_different_warehouse, allowDlocRepeatAtDifferentZone);
            return(dal.UpdateInfo(fields, id) > 0 ? true : false);
        }
Ejemplo n.º 2
0
        public static void EnviarEmail(string destino, string mensagem, string titulo)
        {
            var        smtp   = ConfigDAL.GetValor("SMTP", "EMAIL");
            SmtpClient client = new SmtpClient(smtp);

            try
            {
                var listaUsuario = UsuarioDAL.Consultar();
                var from         = ConfigDAL.GetValor("EMAILFROM", "EMAIL");
                var pass         = ConfigDAL.GetValor("EMAILSENHA", "EMAIL");

                var msg = new MailMessage(from, destino, titulo, mensagem);
                msg.IsBodyHtml = true;

                client.Credentials = new NetworkCredential(from, pass);
                //client.Send(from, destino, titulo, mensagem);
                client.Send(msg);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                client.Dispose();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fields"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool UpdateInfo(string fields, long id)
        {
            ZonesInfo info = dal.GetInfo(id);

            if (info == null)
            {
                throw new Exception("MC:0x00000084");///数据错误
            }
            ///存储区名称
            info.ZoneName = CommonBLL.GetFieldValue(fields, "ZONE_NAME");
            ///仓库代码
            info.WmNo = CommonBLL.GetFieldValue(fields, "WM_NO");
            WarehouseInfo warehouseInfo = new WarehouseDAL().GetWarehouseInfo(info.WmNo);

            if (warehouseInfo == null)
            {
                throw new Exception("MC:0x00000230");///仓库信息不存在
            }
            ///是否结算
            string settlement_flag = CommonBLL.GetFieldValue(fields, "SETTLEMENT_FLAG");

            if (bool.TryParse(settlement_flag, out bool bool_settlement_flag))
            {
                info.Settlementflag = bool_settlement_flag;
            }
            ///SAP库存地点
            info.StockPlaceNo = CommonBLL.GetFieldValue(fields, "STOCK_PLACE_NO");
            ///允许存储区代码在不同的仓库中重复使用
            string allow_zoneno_repeat_at_different_warehouse = new ConfigDAL().GetValueByCode("ALLOW_ZONENO_REPEAT_AT_DIFFERENT_WAREHOUSE");

            ///数据校验
            ValidInfo(info, allow_zoneno_repeat_at_different_warehouse);

            return(dal.UpdateInfo(fields, id) > 0 ? true : false);
        }
Ejemplo n.º 4
0
        public void BindTreeView()
        {
            trvConfig.Nodes.Clear();
            TreeNode root = new TreeNode()
            {
                Text = "系统基本信息"
            };

            trvConfig.Nodes.Add(root);

            ConfigDAL dal       = new ConfigDAL();
            var       allConfig = dal.GetAllConfigGroup();

            foreach (var item in allConfig)
            {
                root.ChildNodes.Add(new TreeNode()
                {
                    Text = item.ConfigGroup_Name, Value = item.ConfigGroup_Id.ToString()
                });
            }
            trvConfig.ExpandAll();

            if (CurrentGroupId > 0 && !string.IsNullOrEmpty(CurrentGroupName))
            {
                ConfigItemDAL itemDAL = new ConfigItemDAL();
                Utility.BindDataToRepeater(rpConfigItemList, itemDAL.GetConfigByGroup(CurrentGroupId));
            }
        }
Ejemplo n.º 5
0
        public static void NotificarCadastro(Afiliado afiliado, List <Dependentes> dependentes)
        {
            try
            {
                var texto = "Foi realizado um cadastro eletrônico, veja abaixo as informações do cadastro";

                texto += "<br/><br/>";
                texto += "<h2>Informações Gerais:</h2><br/>";
                texto += "<strong>Nome:</strong> " + afiliado.Nome + "<br/>";
                texto += "<strong>E-mail:</strong> " + afiliado.Email + "<br/>";
                texto += "<strong>Empresa:</strong> " + afiliado.Empresa + "<br/>";
                texto += "<strong>CNPJ:</strong> " + afiliado.CNPJ + "<br/>";
                texto += "<strong>CPF:</strong> " + afiliado.CPF + "<br/>";
                texto += "<strong>CTPS:</strong> " + afiliado.CTPS.Numero + " <strong>Série:</strong> " + afiliado.CTPS.Serie + "<br/>";
                texto += "<strong>PIS:</strong> " + afiliado.CTPS.PIS + "<br/>";
                texto += "<strong>Data de Nascimento:</strong> " + afiliado.DataNascimento + "<br/>";
                texto += "<h2>Opção de Contribuição e Pagamento:</h2><br/>";
                texto += "<strong>Pagamento:</strong> " + afiliado.PagamentoTx + "<br/>";
                texto += "<strong>Contribuição:</strong> " + afiliado.ContribuicaoTx + "<br/>";
                texto += "<h2>Endereço:</h2><br/>";
                texto += "<strong>Logradouto:</strong> " + afiliado.Endereco.Logradouro + "<br/>";
                texto += "<strong>Número:</strong> " + afiliado.Endereco.Numero + " ";
                texto += "<strong>Complemento:</strong> " + afiliado.Endereco.Complemento + "<br/>";
                texto += "<strong>Bairro:</strong> " + afiliado.Endereco.Bairro + "<br/>";
                texto += "<strong>Cidade:</strong> " + afiliado.Endereco.Cidade + "-" + afiliado.Endereco.UF + "<br/>";
                texto += "<strong>CEP:</strong> " + afiliado.Endereco.CEP + "<br/>";
                texto += "<h2>Dependentes:</h2><br/>";

                foreach (var item in dependentes)
                {
                    texto += "<strong>- Nome:</strong> " + item.Nome + " | " +
                             "<strong>Dt.Nasc:</strong> " + item.DataNascimento + " | " +
                             "<strong>Grau:</strong> " + item.GrauParentescoNome + "<br/>";
                }

                var titulo       = ConfigDAL.GetValor("EMAILTIT", "EMAIL");
                var listaDestino = UsuarioServico.Consultar("", 0);
                var destino      = "";

                foreach (var item in listaDestino)
                {
                    destino += "" + item.Email.Trim() + ",";
                }

                //removendo utlima virgula
                if (destino.Trim().Length > 0)
                {
                    destino = destino.Substring(0, destino.Trim().Length - 1);
                }

                EnviarEmail(
                    destino,
                    montarMensagem(texto, titulo),
                    titulo);
            }
            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// WMM-006 标签拣配
        /// </summary>
        /// <param name="PickupInfos"></param>
        /// <returns></returns>
        public bool PickupInfos(List <string> rowsKeyValues, string loginUser)
        {
            List <BarcodeInfo> barcodeInfos = dal.GetList("[ID] in (" + string.Join(",", rowsKeyValues.ToArray()) + ") ", string.Empty);

            if (barcodeInfos.Count == 0)
            {
                throw new Exception("MC:0x00000276");///标签信息错误
            }
            string sql = string.Empty;

            foreach (var barcodeInfo in barcodeInfos)
            {
                if (barcodeInfo.BarcodeStatus.GetValueOrDefault() == (int)BarcodeStatusConstants.Invalid)
                {
                    throw new Exception("MC:0x00000277");///标签已作废
                }
                if (barcodeInfo.BarcodeStatus.GetValueOrDefault() == (int)BarcodeStatusConstants.Frozen)
                {
                    throw new Exception("MC:0x00000361");///标签已冻结
                }
                if (barcodeInfo.BarcodeStatus.GetValueOrDefault() == (int)BarcodeStatusConstants.Outbound)
                {
                    throw new Exception("MC:0x00000364");///标签已出库
                }
                if (barcodeInfo.BarcodeStatus.GetValueOrDefault() == (int)BarcodeStatusConstants.Shiped)
                {
                    throw new Exception("MC:0x00000365");///标签已发货
                }
                if (barcodeInfo.BarcodeStatus.GetValueOrDefault() == (int)BarcodeStatusConstants.Scaned)
                {
                    throw new Exception("MC:0x00000366");///标签已扫描
                }
                sql += BarcodeDAL.GetBarcodeUpdateSql((int)BarcodeStatusConstants.PickedUp
                                                      , barcodeInfo.WmNo
                                                      , barcodeInfo.ZoneNo
                                                      , barcodeInfo.Dloc
                                                      , barcodeInfo.AsnRunsheetNo
                                                      , barcodeInfo.Fid.GetValueOrDefault()
                                                      , loginUser);
            }
            ///是否在客户端扫描标签条码后更新状态为已扫描
            string client_scaned_barcode_update_barcode_status_flag = new ConfigDAL().GetValueByCode("CLIENT_SCANED_BARCODE_UPDATE_BARCODE_STATUS_FLAG");

            ///执行
            using (TransactionScope trans = new TransactionScope())
            {
                if (!string.IsNullOrEmpty(sql) && client_scaned_barcode_update_barcode_status_flag.ToLower() == "true")
                {
                    CommonDAL.ExecuteNonQueryBySql(sql);
                }
                trans.Complete();
            }
            return(true);
        }
Ejemplo n.º 7
0
        protected void trvConfig_SelectedNodeChanged(object sender, EventArgs e)
        {
            TreeNode node = trvConfig.SelectedNode;

            if (node != null && node.Parent != null)
            {
                CurrentGroupId   = int.Parse(node.Value);
                CurrentGroupName = node.Text;
                ConfigDAL dal = new ConfigDAL();
                Utility.BindDataToRepeater(rpConfigItemList, dal.GetConfigByGroup(CurrentGroupId));
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// InsertInfo
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public long InsertInfo(PartsStockInfo info)
        {
            ///入库包装数量⑧不能小于等于零,当入库包装型号⑦不为空时入库包装数量⑧为必填项
            if (!string.IsNullOrEmpty(info.InboundPackageModel) && info.InboundPackage.GetValueOrDefault() <= 0)
            {
                throw new Exception("MC:0x00000089");///当入库包装型号不为空时入库包装数量必须大于零
            }
            ///最小库存 小于等于 安全库存 小于 最大库存,最小库存必须大于等于零
            if (info.Min.GetValueOrDefault() > info.SafeStock.GetValueOrDefault())
            {
                throw new Exception("MC:0x00000090");///最小库存不能大于安全库存
            }
            //if (info.IsOutput == true)
            //{
            //    if (info.SynchronousWmNo == "" || info.SynchronousZoneNo == "")
            //        throw new Exception("MC:0x00000439");///当同步出库标记为是时,同步出库仓库,存储区为必填项
            //}

            if (info.SafeStock.GetValueOrDefault() >= 0 &&
                info.Max.GetValueOrDefault() > 0 &&
                info.SafeStock.GetValueOrDefault() >= info.Max.GetValueOrDefault())
            {
                throw new Exception("MC:0x00000091");///安全库存不能大于等于最大库存
            }
            ///相同物料号②、供应商代码①、仓库代码⑨、存储区代码⑩、库位代码⑪的数据不允许重复
            int cnt = dal.GetCounts("[PART_NO] = N'" + info.PartNo + "' and [SUPPLIER_NUM] = N'" + info.SupplierNum + "' and [WM_NO] = N'" + info.WmNo + "' and [ZONE_NO] = N'" + info.ZoneNo + "'"
                                    + (string.IsNullOrEmpty(info.Dloc) ? string.Empty : " and [DLOC] = N'" + info.Dloc + "'"));

            if (cnt > 0)
            {
                throw new Exception("MC:0x00000094");///相同物料号、供应商代码、仓库代码、存储区代码、库位代码的数据不允许重复
            }
            ///若该标记为true时,需要校验该仓库存储区下所有物料的同步出库仓库、同步出库存储区必须相同,是否同步出库默认为false
            string sameZoneSameFinalZoneValidFlag = new ConfigDAL().GetValueByCode("SAME_ZONE_SAME_FINAL_ZONE_VALID_FLAG");

            //if (Convert.ToBoolean(sameZoneSameFinalZoneValidFlag) == true )
            //{
            //    //判断数据库中是否存在 仓库、存储区、是否同步出库 如果没有跳过如果有进行判断是否同步出库仓库、同步出库存储区一致
            //    int count = new PartsStockDAL().GetCounts("[WM_NO] = N'" + info.WmNo + "' and[ZONE_NO] = N'" + info.ZoneNo );
            //    if (count != 0)
            //    {
            //        count = new PartsStockDAL().GetCounts("[WM_NO] = N'" + info.WmNo + "' and[ZONE_NO] = N'" + info.ZoneNo + "' and [IS_OUTPUT] = N'" + info.IsOutput + "' and [SYNCHRONOUS_WM_NO] = N'" + info.SynchronousWmNo + "' and [SYNCHRONOUS_ZONE_NO] = N'" + info.SynchronousZoneNo + "'");
            //        if (count == 0)
            //            throw new Exception("MC:0x00000438");///需要校验该仓库存储区下所有物料的同步出库仓库、同步出库存储区必须相同
            //    }


            //}
            return(dal.Add(info));
        }
Ejemplo n.º 9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <param name="loginUser"></param>
        /// <returns></returns>
        public bool LogicDeleteInfo(long id, string loginUser)
        {
            ///是否启用路径中途点配置
            string routeMidEnableFlag = new ConfigDAL().GetValueByCode("ROUTE_MID_ENABLE_FLAG");

            if (routeMidEnableFlag.ToLower() == "true")
            {
                int cnt = new RouteMidDAL().GetCounts("[ROUTE_FID] in (select [FID] from LES.[TM_BAS_ROUTE] with(nolock) where [VALID_FLAG] = 1 and [ID] = " + id + ")");
                if (cnt > 0)
                {
                    throw new Exception("MC:0x00000324");///路径有中途点不能删除
                }
            }
            return(dal.LogicDelete(id, loginUser) > 0 ? true : false);
        }
Ejemplo n.º 10
0
        public string GetConfig()
        {
            MMessage <ICollection <MConfig> > msg = new MMessage <ICollection <MConfig> >();

            msg.Flag = isValid(soapHeader, out msg.Text);
            if (msg.Flag)
            {
                msg.Flag = ConfigDAL.GetConfig(soapHeader.PosNO, out msg.Content, out msg.Text);
            }
            if (!msg.Flag)
            {
                WriteLog("GetConfig", msg.Flag, msg.Text);
            }
            return(Converter.Serialize(msg));
        }
Ejemplo n.º 11
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtGroupName.Text))
     {
         ConfigDAL dal = new ConfigDAL();
         if (!dal.GetAllConfigGroup().Exists(c => c.ConfigGroup_Name == txtGroupName.Text))
         {
             dal.AddConfigGroup(new ConfigGroup()
             {
                 ConfigGroup_Name = txtGroupName.Text
             });
             dal.Save();
         }
         BindTreeView();
     }
 }
Ejemplo n.º 12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public long InsertInfo(ZonesInfo info)
        {
            WarehouseInfo warehouseInfo = new WarehouseDAL().GetWarehouseInfo(info.WmNo);

            if (warehouseInfo == null)
            {
                throw new Exception("MC:0x00000230");///仓库信息不存在
            }
            ///允许存储区代码在不同的仓库中重复使用
            string allow_zoneno_repeat_at_different_warehouse = new ConfigDAL().GetValueByCode("ALLOW_ZONENO_REPEAT_AT_DIFFERENT_WAREHOUSE");

            ///数据校验
            ValidInfo(info, allow_zoneno_repeat_at_different_warehouse);

            return(dal.Add(info));
        }
        /// <summary>
        /// 分页获取集合
        /// </summary>
        /// <param name="textWhere">string 条件语句,无须where</param>
        /// <param name="textOrder">string 排序语句,无须order by</param>
        /// <param name="pageIndex">int 页码,从1开始</param>
        /// <param name="pageRow">int 每页行数</param>
        /// <param name="dataCount">out int 数据行数</param>
        /// <returns>List<VmiShippingPartInfo></returns>
        public List <VmiShippingPartInfo> GetListByPage(string textWhere, string textOrder, int pageIndex, int pageRow, out int dataCount)
        {
            dataCount = dal.GetCounts(textWhere);
            List <VmiShippingPartInfo> vmiShippingPartInfos = dal.GetListByPage(textWhere, textOrder, pageIndex, pageRow);
            ///VMI发货时默认计算发货数量
            string vmi_shipping_default_calculate_confirm_qty = new ConfigDAL().GetValueByCode("VMI_SHIPPING_DEFAULT_CALCULATE_CONFIRM_QTY");

            if (!string.IsNullOrEmpty(vmi_shipping_default_calculate_confirm_qty) && vmi_shipping_default_calculate_confirm_qty.ToLower() == "true")
            {
                ///默认预发货数量
                vmiShippingPartInfos.ForEach(delegate(VmiShippingPartInfo info)
                {
                    info.AsnConfirmQty = info.AsnDraftQty.GetValueOrDefault();
                });
            }
            return(vmiShippingPartInfos);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 分页获取集合
        /// </summary>
        /// <param name="textWhere">string 条件语句,无须where</param>
        /// <param name="textOrder">string 排序语句,无须order by</param>
        /// <param name="pageIndex">int 页码,从1开始</param>
        /// <param name="pageRow">int 每页行数</param>
        /// <param name="dataCount">out int 数据行数</param>
        /// <returns>List<TwdPullOrderDetailInfo></returns>
        public List <VmiPullOrderDetailInfo> GetListByPage(string textWhere, string textOrder, int pageIndex, int pageRow, out int dataCount)
        {
            textWhere += "and isnull([ASN_CONFIRM_QTY],0) < isnull([REQUIRED_PART_QTY],0) " +
                         "and [ORDER_FID] in (select [FID] from [LES].[TT_MPM_VMI_PULL_ORDER] with(nolock) " +
                         "where [VALID_FLAG] = 1 and [ORDER_STATUS] = " + (int)PullOrderStatusConstants.Released + ")";
            dataCount = dal.GetCounts(textWhere);
            List <VmiPullOrderDetailInfo> vmiPullOrderDetailInfos = dal.GetListByPage(textWhere, textOrder, pageIndex, pageRow);
            ///
            string vmi_asn_default_calculate_asn_qty = new ConfigDAL().GetValueByCode("VMI_ASN_DEFAULT_CALCULATE_ASN_QTY");

            if (!string.IsNullOrEmpty(vmi_asn_default_calculate_asn_qty) && vmi_asn_default_calculate_asn_qty.ToLower() == "true")
            {
                ///默认预发货数量
                vmiPullOrderDetailInfos.ForEach(delegate(VmiPullOrderDetailInfo info)
                {
                    info.AsnQty = info.RequiredPartQty.GetValueOrDefault() - info.AsnDraftQty.GetValueOrDefault() - info.AsnConfirmQty.GetValueOrDefault();
                });
            }
            return(vmiPullOrderDetailInfos);
        }
        /// <summary>
        /// GetNewToken
        /// </summary>
        /// <param name="userFid"></param>
        /// <returns></returns>
        public string GetNewToken(Guid userFid)
        {
            ///TOKEN超时时间
            string userTokenExpireMinute = new ConfigDAL().GetValueByCode("USER_TOKEN_EXPIRE_MINUTE");

            if (!int.TryParse(userTokenExpireMinute, out int tokenExpireMinute))
            {
                tokenExpireMinute = 120;
            }
            ///获取有无未过期的TOKEN
            UserTokenInfo info = new UserTokenDAL().GetInfo(userFid);

            if (info == null)
            {
                info     = new UserTokenInfo();
                info.Fid = Guid.NewGuid();

                ///GUID去掉-
                info.Token = info.Fid.GetValueOrDefault().ToString().Replace("-", string.Empty);
                ///
                info.DisableDate = DateTime.Now.AddMinutes(tokenExpireMinute);
                info.CreateDate  = DateTime.Now;
                info.CreateUser  = "******";
                info.ValidFlag   = true;
                if (dal.Add(info) == 0)
                {
                    return(string.Empty);
                }
                return(info.Token);
            }
            ///
            dal.UpdateInfo("" +
                           "[DISABLE_DATE] = N'" + DateTime.Now.AddMinutes(tokenExpireMinute) + "'," +
                           "[MODIFY_DATE] = GETDATE()," +
                           "[MODIFY_USER] = N'#TOKEN_CREATER'",
                           info.Id);
            return(info.Token);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public long InsertInfo(WarehouseLocationInfo info)
        {
            WarehouseInfo warehouseInfo = new WarehouseDAL().GetWarehouseInfo(info.WmNo);

            if (warehouseInfo == null)
            {
                throw new Exception("MC:0x00000230");///仓库信息不存在
            }
            ZonesInfo zonesInfo = new ZonesDAL().GetZonesInfo(info.ZoneNo, info.WmNo);

            if (zonesInfo == null)
            {
                throw new Exception("MC:0x00000500");///存储区不存在
            }
            ///允许存储区代码在不同的仓库中重复使用
            string allow_zoneno_repeat_at_different_warehouse = new ConfigDAL().GetValueByCode("ALLOW_ZONENO_REPEAT_AT_DIFFERENT_WAREHOUSE");
            ///允许库位代码在不同的存储区中重复使用
            string allowDlocRepeatAtDifferentZone = new ConfigDAL().GetValueByCode("ALLOW_DLOC_REPEAT_AT_DIFFERENT_ZONE");

            ///数据校验
            ValidInfo(info, allow_zoneno_repeat_at_different_warehouse, allowDlocRepeatAtDifferentZone);
            return(dal.Add(info));
        }
Ejemplo n.º 17
0
 /// <summary>
 /// 返回系统最大期数
 /// </summary>
 /// <returns></returns>
 public static int GetMaxExpectNum()
 {
     return(ConfigDAL.GetMaxExpectNum());
 }
Ejemplo n.º 18
0
        /// <summary>
        /// InsertInfo
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public long InsertInfo(ReceiveDetailInfo info)
        {
            ReceiveInfo receiveInfo = new ReceiveDAL().GetInfo(info.ReceiveFid.GetValueOrDefault());

            if (receiveInfo == null)
            {
                throw new Exception("MC:0x00000084");///数据错误
            }
            if (dal.GetList("[RECEIVE_FID] = N'" + info.ReceiveFid + "' and [PART_NO] = N'" + info.PartNo + "' and [SUPPLIER_NUM] = N'" + info.SupplierNum + "'", string.Empty).Count > 0)
            {
                throw new Exception("MC:0x00000464");///同物料号供应商不能一致
            }
            //if (receiveInfo.Status.GetValueOrDefault() != (int)WmmOrderStatusConstants.Created)
            //    throw new Exception("MC:0x00000152");///入库单处理已创建状态时才能添加材料

            int cnt = 0;
            ///入库单是否按供应商类型校验
            string receiveOrderValidSupplierTypeFlag = new ConfigDAL().GetValueByCode("RECEIVE_ORDER_VALID_SUPPLIER_TYPE_FLAG");

            if (receiveOrderValidSupplierTypeFlag.ToLower() == "true")
            {
                ///需要校验入库单的供应商是否为储运供应商
                cnt = new SupplierDAL().GetCounts("[SUPPLIER_TYPE] = " + (int)SupplierTypeConstants.LogisticsSupplier + " and [SUPPLIER_NUM] = N'" + receiveInfo.SupplierNum + "'");

                ///储运供应商标记
                bool logisticsSupplierFlag = cnt == 0 ? false : true;
                if (logisticsSupplierFlag)
                {
                    cnt = dal.GetCounts("[PART_NO] = N'" + info.PartNo + "' and [SUPPLIER_NUM] = N'" + info.SupplierNum + "' and [RECEIVE_FID] = N'" + info.ReceiveFid.GetValueOrDefault() + "'");
                    if (cnt > 0)
                    {
                        throw new Exception("MC:0x00000175");///同一入库单下不能出现相同供应商的物料编码
                    }
                }
                else
                {
                    ///入库单明细与入库单不是同一家供应商
                    cnt = new ReceiveDAL().GetCounts("[SUPPLIER_NUM] = N'" + info.SupplierNum + "' and [FID] = N'" + info.ReceiveFid.GetValueOrDefault() + "'");
                    if (cnt == 0)
                    {
                        throw new Exception("MC:0x00000176");///入库单的物料供应商与入库明细的供应商不一致
                    }
                    cnt = dal.GetCounts("[PART_NO] = N'" + info.PartNo + "' and [RECEIVE_FID] = N'" + info.ReceiveFid.GetValueOrDefault() + "'");
                    if (cnt > 0)
                    {
                        throw new Exception("MC:0x00000177");///同一入库单下不能出现相同的物料编码
                    }
                }
            }

            ///明细中供应商缺失时,从单据上获取
            if (string.IsNullOrEmpty(info.SupplierNum))
            {
                info.SupplierNum = receiveInfo.SupplierNum;
            }
            ///单据号
            if (string.IsNullOrEmpty(info.TranNo))
            {
                info.TranNo = receiveInfo.ReceiveNo;
            }
            ///拉动单号
            if (string.IsNullOrEmpty(info.RunsheetNo))
            {
                info.RunsheetNo = receiveInfo.RunsheetNo;
            }
            ///工厂
            if (string.IsNullOrEmpty(info.Plant))
            {
                info.Plant = receiveInfo.Plant;
            }
            ///仓库
            if (string.IsNullOrEmpty(info.TargetWm))
            {
                info.TargetWm = receiveInfo.WmNo;
            }
            ///存储区
            if (string.IsNullOrEmpty(info.TargetZone))
            {
                info.TargetZone = receiveInfo.ZoneNo;
            }

            ///来源
            ///仓库
            //if (string.IsNullOrEmpty(info.WmNo)) info.WmNo = receiveInfo.SourceWmNo;
            /////存储区
            //if (string.IsNullOrEmpty(info.ZoneNo)) info.ZoneNo = receiveInfo.SourceZoneNo;

            ///创建入库单时实收数量等于需求数量
            string createReceiveActualQtyEqualsRequired = new ConfigDAL().GetValueByCode("CREATE_RECEIVE_ACTUAL_QTY_EQUALS_REQUIRED");

            if (createReceiveActualQtyEqualsRequired.ToLower() == "true")
            {
                info.ActualBoxNum = info.RequiredBoxNum;
                info.ActualQty    = info.RequiredQty;
            }
            ///如果需求箱数大于零
            if (info.RequiredBoxNum.GetValueOrDefault() > 0)
            {
                ///如果未填写单包装毛重,但是填写了总毛重,需要计算
                if (info.PerpackageGrossWeight.GetValueOrDefault() == 0 && info.SumWeight.GetValueOrDefault() > 0)
                {
                    info.PerpackageGrossWeight = info.SumWeight.GetValueOrDefault() / info.RequiredBoxNum.GetValueOrDefault();
                }
                ///体积也是如此处理
                if (info.PackageVolume.GetValueOrDefault() == 0 && info.SumVolume.GetValueOrDefault() > 0)
                {
                    info.PackageVolume = info.SumVolume.GetValueOrDefault() / info.RequiredBoxNum.GetValueOrDefault();
                }
                ///件数也是如此处理
                if (info.Package.GetValueOrDefault() == 0 && info.RequiredQty.GetValueOrDefault() > 0)
                {
                    info.Package = Math.Ceiling(info.RequiredQty.GetValueOrDefault() / info.RequiredBoxNum.GetValueOrDefault());
                }
            }
            ///
            return(dal.Add(info));
        }
        /// <summary>
        /// InsertInfo
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public long InsertInfo(VmiOutputDetailInfo info)
        {
            VmiOutputInfo outputInfo = new VmiOutputDAL().GetInfo(info.OutputFid.GetValueOrDefault());

            if (outputInfo == null)
            {
                throw new Exception("MC:0x00000084");///数据错误
            }
            if (outputInfo.Status.GetValueOrDefault() != (int)WmmOrderStatusConstants.Created)
            {
                throw new Exception("MC:0x00000506");///出库单为已创建状态才能添加物料
            }
            ///
            if (dal.GetList("[OUTPUT_FID] = N'" + info.OutputFid + "' and [PART_NO] = N'" + info.PartNo + "' and [SUPPLIER_NUM] = N'" + info.SupplierNum + "'", string.Empty).Count > 0)
            {
                throw new Exception("MC:0x00000464");///同物料号供应商不能一致
            }
            ///
            if (info.RequiredQty.GetValueOrDefault() <= 0)
            {
                throw new Exception("MC:0x00000507");///物料需求数量不能小于等于零
            }
            ///有单包装数量时需要计算
            if (info.Package.GetValueOrDefault() > 0)
            {
                info.RequiredBoxNum = Convert.ToInt32(Math.Ceiling(info.RequiredQty.GetValueOrDefault() / info.Package.GetValueOrDefault()));
            }

            ///单据号
            if (string.IsNullOrEmpty(info.TranNo))
            {
                info.TranNo = outputInfo.OutputNo;
            }
            ///仓库
            if (string.IsNullOrEmpty(info.WmNo))
            {
                info.WmNo = outputInfo.WmNo;
            }
            if (string.IsNullOrEmpty(info.TargetWm))
            {
                info.TargetWm = outputInfo.TWmNo;
            }
            ///存储区
            if (string.IsNullOrEmpty(info.ZoneNo))
            {
                info.ZoneNo = outputInfo.ZoneNo;
            }
            if (string.IsNullOrEmpty(info.TargetZone))
            {
                info.TargetZone = outputInfo.TZoneNo;
            }
            ///创建VMI出库单时实发数量等于需求数量
            string create_vmi_output_actual_qty_equals_required = new ConfigDAL().GetValueByCode("CREATE_VMI_OUTPUT_ACTUAL_QTY_EQUALS_REQUIRED");

            if (!string.IsNullOrEmpty(create_vmi_output_actual_qty_equals_required) && create_vmi_output_actual_qty_equals_required.ToLower() == "true")
            {
                if (info.ActualQty == null)
                {
                    info.ActualQty = info.RequiredQty;
                }
                if (info.ActualBoxNum == null)
                {
                    info.ActualBoxNum = info.RequiredBoxNum;
                }
            }
            ///
            return(dal.Add(info));
        }
        /// <summary>
        /// UpdateInfo
        /// </summary>
        /// <param name="fields"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool UpdateInfo(string fields, long id)
        {
            VmiOutputDetailInfo vmiOutputDetailInfo = dal.GetInfo(id);

            if (vmiOutputDetailInfo == null)
            {
                throw new Exception("MC:0x00000084");///数据错误
            }
            VmiOutputInfo vmiOutputInfo = new VmiOutputDAL().GetInfo(vmiOutputDetailInfo.OutputFid.GetValueOrDefault());

            if (vmiOutputInfo == null)
            {
                throw new Exception("MC:0x00000084");///出库单数据错误
            }
            if (vmiOutputInfo.Status == (int)WmmOrderStatusConstants.Completed ||
                vmiOutputInfo.Status == (int)WmmOrderStatusConstants.Closed)
            {
                throw new Exception("MC:0x00000412");///出库单状态为已关闭或已完成时不能修改其内容
            }
            ///修改用户
            string loginUser = CommonBLL.GetFieldValue(fields, "MODIFY_USER");

            if (vmiOutputInfo.Status == (int)WmmOrderStatusConstants.Published)
            {
                ///实收数量
                string actualQty = CommonBLL.GetFieldValue(fields, "ACTUAL_QTY");
                if (string.IsNullOrEmpty(actualQty))
                {
                    actualQty = "NULL";
                }
                if (Convert.ToDecimal(actualQty) > vmiOutputDetailInfo.RequiredQty.GetValueOrDefault())
                {
                    throw new Exception("MC:0x00000424");///实收数不能大于需求数
                }
                ///实收箱数
                string actualBoxNum = CommonBLL.GetFieldValue(fields, "ACTUAL_BOX_NUM");
                if (string.IsNullOrEmpty(actualBoxNum))
                {
                    actualBoxNum = "NULL";
                }

                fields = "[ACTUAL_QTY] = " + actualQty + ",[ACTUAL_BOX_NUM] = " + actualBoxNum + ",[MODIFY_DATE] = GETDATE(),[MODIFY_USER] = N'" + loginUser + "' ";
                ///
                return(dal.UpdateInfo(fields, id) > 0 ? true : false);
            }
            ///
            string partNo      = CommonBLL.GetFieldValue(fields, "PART_NO");
            string supplierNum = CommonBLL.GetFieldValue(fields, "SUPPLIER_NUM");

            ///
            if (dal.GetList("[OUTPUT_FID] = N'" + vmiOutputInfo.Fid.GetValueOrDefault() + "' and " +
                            "[PART_NO] = N'" + partNo + "' and " +
                            "[SUPPLIER_NUM] = N'" + supplierNum + "' and " +
                            "[ID] <> " + id + "", string.Empty).Count > 0)
            {
                throw new Exception("MC:0x00000464");///同物料号供应商不能一致
            }
            ///实收数量
            string requiredQty = CommonBLL.GetFieldValue(fields, "REQUIRED_QTY");

            if (string.IsNullOrEmpty(requiredQty))
            {
                requiredQty = "0";
            }
            if (Convert.ToDecimal(requiredQty) <= 0)
            {
                throw new Exception("MC:0x00000507");///物料需求数量不能小于等于零
            }
            ///创建VMI出库单时实发数量等于需求数量
            string create_vmi_output_actual_qty_equals_required = new ConfigDAL().GetValueByCode("CREATE_VMI_OUTPUT_ACTUAL_QTY_EQUALS_REQUIRED");
            ///实收数量
            string package = CommonBLL.GetFieldValue(fields, "PACKAGE");

            if (string.IsNullOrEmpty(package))
            {
                package = "0";
            }
            ///有单包装数量时需要计算
            if (Convert.ToDecimal(package) > 0)
            {
                int requiredBoxNum = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(requiredQty) / Convert.ToDecimal(package)));
                fields = CommonBLL.SetFieldValue(fields, "REQUIRED_BOX_NUM", requiredBoxNum.ToString(), false);
                if (!string.IsNullOrEmpty(create_vmi_output_actual_qty_equals_required) && create_vmi_output_actual_qty_equals_required.ToLower() == "true")
                {
                    fields = CommonBLL.SetFieldValue(fields, "ACTUAL_BOX_NUM", requiredBoxNum.ToString(), false);
                }
            }
            if (!string.IsNullOrEmpty(create_vmi_output_actual_qty_equals_required) && create_vmi_output_actual_qty_equals_required.ToLower() == "true")
            {
                fields = CommonBLL.SetFieldValue(fields, "ACTUAL_QTY", requiredQty.ToString(), false);
            }

            return(dal.UpdateInfo(fields, id) > 0 ? true : false);
        }
Ejemplo n.º 21
0
 /// <summary>
 /// 从结算表中获取所有的日期和期数
 /// </summary>
 /// <returns>返回DataTable对象</returns>
 public static DataTable GetAllExpectNumDateFromConfig()
 {
     return(ConfigDAL.GetAllExpectNumDateFromConfig());
 }
Ejemplo n.º 22
0
 public static int UpdateConfig2(ConfigModel model)
 {
     return(ConfigDAL.UpdateConfig2(model));
 }
Ejemplo n.º 23
0
    /// <summary>
    /// 购买矿机
    /// </summary>
    /// <param name="chosenum"></param>
    /// <returns></returns>
    public void GetRegSendPost()
    {
        int chosenum = Convert.ToInt32(hidetp.Value);

        if (Session["Member"] == null)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('未登录!');</script>", false);
            return;  //未登录
        }
        string number = Session["Member"].ToString();

        int cc = Convert.ToInt32(DBHelper.ExecuteScalar("select  count(0)  from memberorder where  DefrayState=1   and  isactive=0 and ordertype<>0  and  number='" + number + "' "));

        if (cc > 0)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('您有未激活的矿机,请激活后再升级!'); setTimeout(function(){ window.location.href='orderlist.aspx'},2000);  </script>", false);
            return;
        }

        int re = 0;
        ///获取usdt账户
        int lv = 0;

        //檢測是否有未支付的單子 如果有則走未支付的訂單

        double ddmm    = 0;
        string orderid = "";

        //DataTable ddt = DBHelper.ExecuteDataTable("select  top 1 OrderID,TotalMoney from memberorder where  DefrayState=0 order by id  ");
        //if (ddt != null && ddt.Rows.Count > 0)
        //{
        //    DataRow dr = ddt.Rows[0];
        //    ddmm = Convert.ToDouble(dr["TotalMoney"]);
        //    orderid =  dr["orderid"].ToString();



        //    return;
        //}

        //清除未支付订单
        DBHelper.ExecuteNonQuery(@" insert  into   memberorderdel(id,[Number],[OrderID],[StoreID],[TotalMoney]
           ,[TotalPv],[CarryMoney],[OrderExpectNum],[PayExpectNum]
           ,[IsAgain],[OrderDate],[Error],[Remark],[DefrayState],[Consignee]
           ,[CCPCCode],[ConCity],[ConAddress]
           ,[ConZipCode],[ConTelphone]
           ,[ConMobilPhone],[ConPost]
           ,[DefrayType],[PayMoney]
           ,[PayCurrency],[StandardCurrency]
           ,[StandardCurrencyMoney],[OperateIP]
           ,[OperateNum],[RemittancesID],[ElectronicAccountID],[ordertype]
           ,[IsReceivables],[PayMentMoney],[ReceivablesDate],[EnoughProductMoney]
           ,[LackProductMoney],[IsReturn],[SendType],[SendWay],[TotalMoneyReturned]
           ,[TotalPvReturned],[OrderStatus],[TotalMoneyReturning],[TotalPvReturning]
           ,[OrderStatus_NR],[Isjjff],[trackingnum],[InvestJB]
           ,[PriceJB],[isSend],[xjpay],[xfpay],[bdpay],[ISSettle])
 select id,[Number],[OrderID],[StoreID],[TotalMoney]
           ,[TotalPv],[CarryMoney],[OrderExpectNum],[PayExpectNum]
           ,[IsAgain],[OrderDate],[Error],[Remark],[DefrayState],[Consignee]
           ,[CCPCCode],[ConCity],[ConAddress]
           ,[ConZipCode],[ConTelphone]
           ,[ConMobilPhone],[ConPost]
           ,[DefrayType],[PayMoney]
           ,[PayCurrency],[StandardCurrency]
           ,[StandardCurrencyMoney],[OperateIP]
           ,[OperateNum],[RemittancesID],[ElectronicAccountID],[ordertype]
           ,[IsReceivables],[PayMentMoney],[ReceivablesDate],[EnoughProductMoney]
           ,[LackProductMoney],[IsReturn],[SendType],[SendWay],[TotalMoneyReturned]
           ,[TotalPvReturned],[OrderStatus],[TotalMoneyReturning],[TotalPvReturning]
           ,[OrderStatus_NR],[Isjjff],[trackingnum],[InvestJB]
           ,[PriceJB],[isSend],[xjpay],[xfpay],[bdpay],[ISSettle]
 from MemberOrder where DefrayState = 0
 and number ='" + number + "'   ");
        //删除未支付的订单
        DBHelper.ExecuteNonQuery("delete  from   memberorder where  DefrayState=0 and number='" + number + "'   ");


        DataTable dt_one = DAL.DBHelper.ExecuteDataTable("select LevelInt from memberinfo where Number='" + number + "'");

        if (dt_one.Rows != null && dt_one.Rows.Count > 0)
        {
            lv = Convert.ToInt32(dt_one.Rows[0]["LevelInt"]);//获取账户等级
        }
        double zhye = 0;
        int    jd   = Common.GetcurJieDuan();//获取阶段状态

        if ((lv == 1 || (lv == 0 && chosenum > 1)) && jd == 1)
        {
            zhye = CommandAPI.GetActMoney();
        }
        if (chosenum < 0 || chosenum > 8 || lv > chosenum)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('请选择矿机!');</script>", false);
            return;
        } //选择购买的矿机

        ConfigModel cm        = ConfigDAL.GetConfig();
        double      ttmoney   = 0;
        double      ttpv      = 0;
        int         ordertype = 22; // 0 第一次购买 1 补差升级
        int         isagain   = 0;
        double      yymoney   = 0;

        //   int ispay = 0; ///支付状态
        if (lv == 0)
        {
            ordertype = 22; //抢购20u
        }
        if (lv == 1 || (lv == 0 && chosenum > 1))
        {
            ordertype = 23; //购买
        }
        if (lv == 2)
        {
            yymoney = cm.Para2;
        }
        if (lv == 3)
        {
            yymoney = cm.Para3;
        }
        if (lv == 4)
        {
            yymoney = cm.Para4;
        }
        if (lv == 5)
        {
            yymoney = cm.Para5;
        }
        if (lv == 6)
        {
            yymoney = cm.Para6;
        }
        if (lv == 7)
        {
            yymoney = cm.Para7;
        }
        if (lv == 7)
        {
            ordertype = 25;           //复投
        }
        if (chosenum == 1)
        {
            ttmoney = cm.Para1; ttpv = 0;
        }                                                   //20u 不计算业绩
        if (chosenum == 2)
        {
            ttmoney = cm.Para2 - yymoney; ttpv = cm.Para2 - yymoney;
        }
        if (chosenum == 3)
        {
            ttmoney = cm.Para3 - yymoney; ttpv = cm.Para3 - yymoney;
        }
        if (chosenum == 4)
        {
            ttmoney = cm.Para4 - yymoney; ttpv = cm.Para4 - yymoney;
        }
        if (chosenum == 5)
        {
            ttmoney = cm.Para5 - yymoney; ttpv = cm.Para5 - yymoney;
        }
        if (chosenum == 6)
        {
            ttmoney = cm.Para6 - yymoney; ttpv = cm.Para6 - yymoney;
        }
        if (chosenum == 7)
        {
            ttmoney = cm.Para7 - yymoney; ttpv = cm.Para7 - yymoney;
        }
        //if (chosenum == 8) { ttmoney = cm.Para28 - yymoney; ttpv = cm.Para28 - yymoney; }
        if (yymoney > 0)
        {
            isagain = 1; ordertype = 24;
        }                                                //升级

        DataTable dtmb = DBHelper.ExecuteDataTable("select pointAin-pointAout  as  ablc,pointbin-pointbout  as  bblc,pointcin-pointcout  as  cblc,pointdin-pointdout  as  dblc,pointein-pointeout  as  eblc  from memberinfo where number='" + number + "'");
        DataTable conp = DBHelper.ExecuteDataTable("select CoinIndex ,coinnewprice  from CoinPlant  order by id ");
        double    ablc = 0; double bblc = 0; double cblc = 0; double dblc = 0; double eblc = 0;
        double    cap = 0; double cbp = 0; double ccp = 0; double cdp = 0; double cep = 0;

        if (dtmb != null && dtmb.Rows.Count > 0)
        {
            DataRow dr = dtmb.Rows[0];
            ablc = Convert.ToDouble(dr["ablc"]);
            bblc = Convert.ToDouble(dr["bblc"]);
            cblc = Convert.ToDouble(dr["cblc"]);
            dblc = Convert.ToDouble(dr["dblc"]);
            eblc = Convert.ToDouble(dr["eblc"]);
        }
        else
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false);
            return;
        }
        if (conp != null && conp.Rows.Count > 0)
        {
            foreach (DataRow item in conp.Rows)
            {
                string s = item["CoinIndex"].ToString();
                if (s == "CoinA")
                {
                    cap = Convert.ToDouble(item["coinnewprice"]);
                }
                if (s == "CoinB")
                {
                    cbp = Convert.ToDouble(item["coinnewprice"]);
                }
                if (s == "CoinC")
                {
                    ccp = Convert.ToDouble(item["coinnewprice"]);
                }
                if (s == "CoinD")
                {
                    cdp = Convert.ToDouble(item["coinnewprice"]);
                }
                if (s == "CoinE")
                {
                    cep = Convert.ToDouble(item["coinnewprice"]);
                }
            }
        }
        else
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false);
            return;
        }


        double aneed = 0;
        double bneed = 0;
        double cneed = 0;
        double eneed = 0;

        if (lv > 0)
        {
            if (jd == 1)
            {
                if (zhye < ttmoney)
                {
                    //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false);
                    //return;
                }//余额不足
                else if (jd == 2 || jd == 3)
                {
                    aneed = ttmoney / cap;
                    if (aneed > ablc)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false);
                        return;
                    }
                    ; //余额不足
                }
                else if (jd == 4 || jd == 5)
                {
                    aneed = (ttmoney * 0.5) / cap;
                    bneed = (ttmoney * 0.5) / cbp;
                    if (aneed > ablc || bneed > bblc)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false);
                        return;
                    }//余额不足
                }
                else if (jd == 6 || jd == 7)
                {
                    aneed = (ttmoney * 0.2) / cap;
                    bneed = (ttmoney * 0.3) / cbp;
                    cneed = (ttmoney * 0.5) / ccp;
                    if (aneed > ablc || bneed > bblc || cneed > cblc)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>  showsuc('账户余额不足!');</script>", false);
                        return;
                    }//余额不足
                }
            }

            if (jd > 0 && chosenum > 1) ///  如果是20u以上 则需要额外支付 5% 的E
            {
                eneed = (ttmoney * 0.05) / cep;
                //if (eneed > eblc)
                //{
                //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('火星币余额不足,请先去抢购兑换!');</script>", false);
                //    return;
                //}
                //余额不足

                Session["Eneed"] = eneed;
            }
        }

        RegistermemberBLL registermemberBLL = new RegistermemberBLL();

        orderid = registermemberBLL.GetOrderInfo("add", null);
        int maxexpt = ConfigDAL.GetMaxExpectNum();

        Boolean flag = new AddOrderDataDAL().AddOrderInfo(number, orderid, maxexpt, isagain, ttmoney, ttpv, ordertype);

        Session["choselv"] = chosenum;   //保存当前选中级别
        if (flag)                        //插入订单成功 开始支付
        {
            if (jd == 1 && chosenum > 1) //说明是第一阶段的所有购买都 必须使用USDT买
            {
                Session["orderid"] = orderid;
                string postf = CommandAPI.GetFunction(orderid, ttmoney.ToString(), "recast.aspx", RadioButtonList1.SelectedValue);
                ClientScript.RegisterStartupScript(this.GetType(), "", postf, false);
                return;
            }

            else
            {
                //本地支付开始
                int r = MemberOrderDAL.PayOrder(number, orderid, aneed, bneed, cneed, eneed, chosenum, "使用本地币种账户支付");
                if (r == 1)
                {
                    //销毁
                    if (aneed > 0)
                    {
                        CommandAPI.Destruction("A", aneed);
                    }
                    if (bneed > 0)
                    {
                        CommandAPI.Destruction("B", bneed);
                    }
                    if (cneed > 0)
                    {
                        CommandAPI.Destruction("C", cneed);
                    }
                    // if (eneed > 0) CommandAPI.Destruction("E", eneed);
                    if (eneed > 0)
                    {
                        int ee = MemberOrderDAL.payOrderEcoin(number, orderid, eneed, "E币支付,激活成功");
                        if (ee == 1)
                        {
                            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('购买矿机激活成功!');</script>", false);
                        }
                        else
                        {
                            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('支付成功,请使用E币激活矿机!'); setTimeout(function(){ window.location.href='orderlist.aspx'},3000); </script>", false);
                        }
                    }


                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('购买成功!');</script>", false);
                    return;
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('购买失败!');</script>", false);
                    return;
                }
            }
        }
    }
Ejemplo n.º 24
0
 /// <summary>
 /// 返回所有的期数和日期
 /// </summary>
 /// <returns></returns>
 public DataTable GetExpectNumAndDates()
 {
     return(ConfigDAL.GetExpectNumAndDates());
 }
Ejemplo n.º 25
0
 /// <summary>
 /// 根据期数更改结算表中的日期
 /// </summary>
 /// <param name="date">日期</param>
 /// <param name="expectNum">期数</param>
 /// <returns>返回更改日期所影响的行数</returns>
 public static int UpdDateByExpectNum(string date, int expectNum, string stardate, string enddate)
 {
     return(ConfigDAL.UpdDateByExpectNum(date, expectNum, stardate, enddate));
 }
Ejemplo n.º 26
0
 /// <summary>
 /// 设置参数
 /// </summary>
 /// <param name="type"></param>
 /// <param name="expectNum"></param>
 /// <param name="p"></param>
 /// <returns></returns>
 public static int UpdatetkType(int type, int expectNum, string p)
 {
     return(ConfigDAL.AddtkType(type, expectNum, p, DateTime.Now));
 }
Ejemplo n.º 27
0
 /// <summary>
 /// 通过期数获取日期
 /// </summary>
 /// <param name="expectNum">期数</param>
 /// <returns>返回日期</returns>
 public static string GetDateByExpectNumFromConfig(int expectNum)
 {
     return(ConfigDAL.GetDateByExpectNumFromConfig(expectNum));
 }
Ejemplo n.º 28
0
 public static bool HastkType(int type, int expectNum, string number)
 {
     return(ConfigDAL.GettkType(type, expectNum, number) >= 1);
 }
Ejemplo n.º 29
0
 /// <summary>
 /// 根据期数获取期数的参数设置
 /// </summary>
 /// <param name="ExpectNum"></param>
 /// <returns></returns>
 public static ConfigModel GetConfig2(int expectNum)
 {
     return(ConfigDAL.GetConfig2(expectNum));
 }
Ejemplo n.º 30
0
 public static int DelTkType(int p)
 {
     return(ConfigDAL.DelTkType(p));
 }