Exemplo n.º 1
0
        public static string EditIssue(Member_Issue issuemodel, string actchecked)
        {
            try
            {
                var issueid = new MemberIssueData().InsertOrUpdate(issuemodel);

                var delissueact = new MemberIssueActivityData().DelIssueIdByIssueId(issueid);

                string[] actgroup = actchecked.Split(',');
                for (int i = 0; i < actgroup.Length; i++)
                {
                    Member_Issue_Activity act = new Member_Issue_Activity()
                    {
                        Id   = 0,
                        ISid = issueid,
                        Acid = int.Parse(actgroup[i])
                    };
                    var issueactid = new MemberIssueActivityData().InsertOrUpdate(act);
                }


                return(JsonConvert.SerializeObject(new { type = 100, msg = issueid }));
            }
            catch
            {
                new SqlHelper().Dispose();
                throw;
            }
        }
Exemplo n.º 2
0
 public int InsertOrUpdate(Member_Issue issuemodel)
 {
     using (var helper = new SqlHelper())
     {
         var id = new InternalMemberIssue(helper).InsertOrUpdate(issuemodel);
         return(id);
     }
 }
Exemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string oper = context.Request["oper"].ConvertTo <string>("");

            if (oper != "")
            {
                if (oper == "editissue")
                {
                    int    issueid     = context.Request["issueid"].ConvertTo <int>(0);
                    string pubtitle    = context.Request["pubtitle"];
                    int    channelid   = context.Request["channelid"].ConvertTo <int>(0);
                    int    cardid      = context.Request["cardid"].ConvertTo <int>(0);
                    int    num         = context.Request["num"].ConvertTo <int>(0);
                    string actchecked  = context.Request["actchecked"];
                    var    isopen1     = context.Request["isopen"];
                    bool   isopen      = context.Request["isopen"].ConvertTo <string>("true") == "true" ? true : false;
                    int    openaddress = context.Request["openaddress"].ConvertTo <int>(0);
                    int    comid       = context.Request["comid"].ConvertTo <int>(0);

                    Member_Issue issuemodel = new Member_Issue()
                    {
                        Id          = issueid,
                        Chid        = channelid,
                        Crid        = cardid,
                        Num         = num,
                        Com_id      = comid,
                        Openyes     = isopen,
                        Openaddress = openaddress,
                        Title       = pubtitle
                    };

                    string data = IssueJsonDate.EditIssue(issuemodel, actchecked);
                    context.Response.Write(data);
                }
                if (oper == "GetIssueDetailById")
                {
                    int    issueid = context.Request["issueid"].ConvertTo <int>(0);
                    string data    = IssueJsonDate.GetIssueDetailById(issueid);
                    context.Response.Write(data);
                }
                if (oper == "GetIssueDetail2")
                {
                    int    issueid = context.Request["issueid"].ConvertTo <int>(0);
                    string data    = IssueJsonDate.GetIssueDetail2(issueid);
                    context.Response.Write(data);
                }


                if (oper == "GetIssuePromot")
                {
                    int    issueid = context.Request["issueid"].ConvertTo <int>(0);
                    string data    = IssueJsonDate.GetIssuePromot(issueid);
                    context.Response.Write(data);
                }
                if (oper == "pagelist")
                {
                    var    comid     = context.Request["comid"];
                    var    pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var    pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    string data      = IssueJsonDate.PageList(comid, pageindex, pagesize);


                    context.Response.Write(data);
                }
                if (oper == "entercardnumber")
                {
                    int issueid = context.Request["issueid"].ConvertTo <int>(0);
                    //var carddd = context.Request["cardnumber"];
                    decimal cardnumber = context.Request["cardnumber"].ConvertTo <decimal>(0);
                    int     comid      = context.Request["comid"].ConvertTo <int>(0);

                    string data = IssueJsonDate.EnterCardNumber(issueid, cardnumber, comid);
                    context.Response.Write(data);
                }
                if (oper == "batchentercardnumber")
                {
                    int     issueid       = context.Request["issueid"].ConvertTo <int>(0);
                    decimal numberbegin   = context.Request["numberbegin"].ConvertTo <decimal>(0);
                    decimal numberend     = context.Request["numberend"].ConvertTo <decimal>(0);
                    int     comid         = context.Request["comid"].ConvertTo <int>(0);
                    bool    ignoreentered = context.Request["ignoreentered"].ConvertTo <bool>(false);

                    string data = IssueJsonDate.BatchEnterCardNumber(issueid, numberbegin, numberend, comid, ignoreentered);
                    //string data = IssueJsonDate.EnterCardNumber(issueid, numberbegin, comid);
                    context.Response.Write(data);
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 公用录入单卡号方法 result:录入成功返回cardid,错误返回错误原因
        /// </summary>
        /// <returns></returns>
        public static bool CommonEnterCardNumber(int issueid, decimal cardnumber, int comid, out string result, Member_Issue issue)
        {
            Member_Card cardinfo = new MemberCardData().GetCardByCardNumber(cardnumber);


            //判断卡号是否存在属于此次发行的卡片类型
            int cardtype      = cardinfo.Crid;
            int issuecardtype = issue.Crid;

            if (cardtype != issuecardtype)
            {
                result = "输入的卡号所属类型和发行需要的卡号类型不相符";
                return(false);
            }

            Member_Channel channel = new MemberChannelData().GetChannelDetail(issue.Chid);
            List <Member_Issue_Activity> actlist = new MemberIssueActivityData().GetIssuePromot(issueid);

            try
            {
                var upMemberCardd = new MemberCardData().UPChannelCardCode(channel.Id, cardnumber, issueid);//更改生成卡号表中卡号所属渠道的id和发行id

                foreach (Member_Issue_Activity issueact in actlist)
                {
                    Member_Card_Activity cardactinfo = new MemberCardActivityData().GetCardActInfo(cardinfo.Id, issueact.Acid);
                    //防止一张卡重复录入同一次活动
                    if (cardactinfo == null)
                    {
                        Member_Card_Activity cardact = new Member_Card_Activity()
                        {
                            Id         = 0,
                            ACTID      = issueact.Acid,
                            Actnum     = 1,
                            CardID     = cardinfo.Id,
                            USEstate   = (int)MemberCardUserState.NotUse,
                            USEsubdate = DateTime.Parse("1900-01-01")
                        };
                        var insertcardact = new MemberCardActivityData().EditMemberCardActivity(cardact);
                    }
                }
                result = upMemberCardd.ToString();
                return(true);
            }
            catch (Exception ex)
            {
                new SqlHelper().Dispose();
                result = "意外错误";
                return(false);

                throw;
            }
        }