Esempio n. 1
0
        /// <summary>
        /// 删除信息\
        /// 根据id删除
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string DeleteBarCodeInfoId(HttpContext context)
        {
            string ids = context.Request["ids"];

            if (string.IsNullOrEmpty(ids))
            {
                resp.Status = -1;
                resp.Msg    = "请至少选择一条记录进行操作!";
                goto OutF;
            }
            BLLJIMP.Model.BarCodeInfo model = new BLLJIMP.Model.BarCodeInfo();
            int count = bll.Delete(model, string.Format(" AutoId in ({0})", ids));

            if (count > 0)
            {
                resp.Status = 0;
                resp.Msg    = "删除成功。";
            }
            else
            {
                resp.Status = -1;
                resp.Msg    = "删除失败";
            }

OutF:
            return(Common.JSONHelper.ObjectToJson(resp));
        }
Esempio n. 2
0
        /// <summary>
        /// 根据条形码查询
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string GetByBarCode(HttpContext context)
        {
            string barCode = context.Request["BarCode"];

            //BLLJIMP.Model.ConfigBarCodeInfo cbcInfo = juActivityBll.Get<BLLJIMP.Model.ConfigBarCodeInfo>(string.Format(" websiteOwner='{0}'", websiteOwner));
            if (string.IsNullOrEmpty(barCode))
            {
                resp.Status = -1;
                resp.Msg    = "您好,请填写你查询的编号!!!";
                goto OurF;
            }
            BLLJIMP.Model.BarCodeInfo barCodeInfo = bllJuActivity.Get <BLLJIMP.Model.BarCodeInfo>(string.Format(" BarCode='{0}' ORDER BY AutoId DESC", barCode));
            if (barCodeInfo != null)
            {
                resp.Status = 0;
                resp.ExObj  = barCodeInfo;
                if (string.IsNullOrEmpty(barCodeInfo.TimeOne))
                {
                    barCodeInfo.TimeOne = DateTime.Now.ToString("yyyy-MM-dd");
                    resp.Msg            = "您输入的号码,已于" + barCodeInfo.TimeOne + "被查询过,至今被查询1次。";
                    resp.Msg           += "还可以查询2次。该产品与" + barCodeInfo.InsetDatastr + "发货至我们蝴蝶" + barCodeInfo.Agency + "经销商处。";
                    resp.Msg           += "该号码所对应的产品为" + barCodeInfo.ModelCode + "。如有疑问可与购买的经销商联系。谢谢";
                }
                else if (string.IsNullOrEmpty(barCodeInfo.TimeTwo))
                {
                    barCodeInfo.TimeTwo = DateTime.Now.ToString("yyyy-MM-dd");
                    resp.Msg            = "您输入的号码,已于" + barCodeInfo.TimeTwo + "被查询过,至今被查询2次。";
                    resp.Msg           += "还可以查询1次。该产品与" + barCodeInfo.InsetDatastr + "发货至我们蝴蝶" + barCodeInfo.Agency + "经销商处。";
                    resp.Msg           += "该号码所对应的产品为" + barCodeInfo.ModelCode + "。如有疑问可与购买的经销商联系。谢谢";
                }
                else if (string.IsNullOrEmpty(barCodeInfo.TimeThree))
                {
                    barCodeInfo.TimeThree = DateTime.Now.ToString("yyyy-MM-dd");
                    resp.Msg  = "您输入的号码,已于" + barCodeInfo.TimeThree + "被查询过,至今被查询3次。";
                    resp.Msg += "还可以查询0次。该产品与" + barCodeInfo.InsetDatastr + "发货至我们蝴蝶" + barCodeInfo.Agency + "经销商处。";
                    resp.Msg += "该号码所对应的产品为" + barCodeInfo.ModelCode + "。如有疑问可与购买的经销商联系。谢谢";
                }
                else
                {
                    resp.ExObj = "";
                    resp.Msg   = "您输入的号码,已于" + barCodeInfo.TimeThree + "被被查查询过,至今被查询3次。不可再查询";
                    //resp.Msg += "还可以查询0次。该产品与" + BCInfo.InsetDatastr + "发货至我们蝴蝶北京利生经销商处";
                    //resp.Msg += "该号码所对应的产品为" + BCInfo.ModelCode + "。如有疑问可与购买的经销商联系。谢谢";
                }
                bool isSuccess = bllJuActivity.Update(barCodeInfo);
            }
            else
            {
                resp.Status = -1;
                resp.Msg    = "没有查询到数据";
            }

OurF:
            return(Common.JSONHelper.ObjectToJson(resp));
        }
Esempio n. 3
0
        /// <summary>
        /// 获取产品真伪信息
        /// </summary>
        /// <returns></returns>
        private string GetBarCodeInfoData(HttpContext context)
        {
            string codeId = context.Request["codeId"];

            BLLJIMP.Model.BarCodeInfo model = bll.Get <BLLJIMP.Model.BarCodeInfo>(string.Format(" CodeId={0}", codeId));
            if (model != null)
            {
                resp.Status = 0;
                resp.ExObj  = model;
            }
            else
            {
                resp.Status = -1;
            }

            return(Common.JSONHelper.ObjectToJson(resp));
        }
Esempio n. 4
0
        /// <summary>
        /// 更新或添加数据
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string AUBarCodeInfoData(HttpContext context)
        {
            string codeId    = context.Request["AutoId"];
            string codeName  = context.Request["CodeName"];
            string barCode   = context.Request["BarCode"];
            string modelCode = context.Request["ModelCode"];
            string agency    = context.Request["Agency"];

            if (string.IsNullOrEmpty(codeName) || string.IsNullOrEmpty(barCode) || string.IsNullOrEmpty(modelCode) || string.IsNullOrEmpty(agency))
            {
                resp.Status = -1;
                resp.Msg    = "请填写完整信息";
                goto OutF;
            }
            BLLJIMP.Model.BarCodeInfo model = bll.Get <BLLJIMP.Model.BarCodeInfo>(string.Format(" bll.WebSiteOwner='{0}' AND AutoId={1}", bll.WebsiteOwner, codeId));
            if (model != null)
            {
                model.CodeName     = codeName;
                model.BarCode      = barCode;
                model.ModelCode    = modelCode;
                model.Agency       = agency;
                model.websiteOwner = bll.WebsiteOwner;
                bool IsTrue = bll.Update(model);
                if (IsTrue)
                {
                    resp.Status = 0;
                    resp.Msg    = "更新成功";
                    goto OutF;
                }
                else
                {
                    resp.Status = 0;
                    resp.Msg    = "更新失败";
                    goto OutF;
                }
            }
            else
            {
                model = new BLLJIMP.Model.BarCodeInfo()
                {
                    CodeName     = codeName,
                    BarCode      = barCode,
                    ModelCode    = modelCode,
                    Agency       = agency,
                    InsetData    = DateTime.Now.ToString("yyyy-MM-dd"),
                    websiteOwner = bll.WebsiteOwner
                };
                bool IsTrue = bll.Add(model);
                if (IsTrue)
                {
                    resp.Status = 0;
                    resp.Msg    = "添加成功";
                    goto OutF;
                }
                else
                {
                    resp.Status = 0;
                    resp.Msg    = "添加失败";
                    goto OutF;
                }
            }

OutF:
            return(Common.JSONHelper.ObjectToJson(resp));
        }
Esempio n. 5
0
 private void GetBarCodeInfo(string AutoId)
 {
     model = jubll.Get <BLLJIMP.Model.BarCodeInfo>("  AutoID=" + AutoId);
 }