Пример #1
0
        public static List <EbulletinList> GetYearWiseEbulletinList(InputGetYearWiseEbull input)
        {
            try
            {
                MySqlParameter[] param = new MySqlParameter[4];
                param[0] = new MySqlParameter("@memberId", input.memberProfileId);
                param[1] = new MySqlParameter("@grpId", input.groupId);
                param[2] = new MySqlParameter("@fromYear", input.fromYear);
                param[3] = new MySqlParameter("@toYear", input.toYear);

                DataSet Result = MySqlHelper.ExecuteDataset(GlobalVar.strAppConn, CommandType.StoredProcedure, "V3_USPGetYearWiseEbulletinList", param);

                DataTable            dtResult      = Result.Tables[0];
                List <EbulletinList> EbulletinList = new List <EbulletinList>();

                if (dtResult.Rows.Count > 0)
                {
                    EbulletinList = GlobalFuns.DataTableToList <EbulletinList>(dtResult);

                    for (int i = 0; i < EbulletinList.Count; i++)
                    {
                        if (!string.IsNullOrEmpty(EbulletinList[i].ebulletinlink) && EbulletinList[i].ebulletinType != "Link")
                        {
                            string ebulletinlink = EbulletinList[i].ebulletinlink.ToString();
                            string path          = ConfigurationManager.AppSettings["imgPath"] + "Documents/ebulletin/Group" + input.groupId + "/";
                            EbulletinList[i].ebulletinlink = path + ebulletinlink;
                        }
                    }
                }

                return(EbulletinList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public object GetYearWiseEbulletinList(InputGetYearWiseEbull input)
        {
            dynamic TBYearWiseEbulletinList;

            try
            {
                List <EbulletinList> Result = Ebulletin.GetYearWiseEbulletinList(input);

                if (Result != null)
                {
                    TBYearWiseEbulletinList = new { status = "0", message = "success", Result = Result };
                }
                else
                {
                    TBYearWiseEbulletinList = new { status = "0", message = "Record not found" };
                }
            }
            catch
            {
                TBYearWiseEbulletinList = new { status = "1", message = "failed" };
            }

            return(new { TBYearWiseEbulletinList });
        }