Esempio n. 1
0
        public string Save(int id, string title, string firstName, string lastName, string position, string directDial, string email, string status, string notes, int customerSupplierId, int?extension)
        {
            string message = string.Empty;

            try
            {
                // convert json string to object
                TblContact contact = GetContact(id, title, firstName, lastName, position, directDial, email, status, notes, customerSupplierId, extension);
                // validation
                if (ValidateContact(contact))
                {
                    // insert
                    if (contact.id == -1)
                    {
                        contactRepository.Insert(contact);
                    }
                    else // update
                    {
                        contactRepository.Update(contact);
                    }

                    unitOfWork.Save();
                    message = "success";
                }
                else
                {
                    message = "Error - Please fill all the mandatory fields";
                }
            }
            catch (Exception ex)
            {
                message = "Error - Server side Json Serialisation error. Please contact IT Support";
            }
            return(message);
        }
Esempio n. 2
0
        public void TestInsertContact()
        {
            // arrange
            int        actualCount   = contactRepository.GetAll().Count();
            int        expectedCount = ++actualCount;
            TblContact contact       = objectProvider.Contact;

            contact.title              = "Mr";
            contact.firstName          = "Mathew";
            contact.lastName           = "Hayden";
            contact.position           = "Senior Consultant";
            contact.directDial         = "123456789";
            contact.email              = "*****@*****.**";
            contact.status             = "active";
            contact.notes              = "likes to play attacking cricket";
            contact.customerSupplierId = 5;

            // act
            try
            {
                contactRepository.Insert(contact);
                unitOfWork.Save();
                actualCount = contactRepository.GetAll().Count();
            }
            catch (Exception)
            {
                // assert
                Assert.Fail("Contact - Insertion Failed");
                return;
            }

            // assert
            Assert.AreEqual(expectedCount, actualCount, "Contact - Excpected and actual record counts after insertion do not match");
        }
Esempio n. 3
0
        public void TestMakeInactiveContact()
        {
            try
            {
                // arrange
                IList <TblContact> allRecords = contactRepository.GetAll().ToList <TblContact>();
                int        lastId             = allRecords.Max(b => b.id);
                TblContact lastRecord         = allRecords.Where(b => b.id == lastId).SingleOrDefault <TblContact>();
                Assert.IsNotNull(lastRecord, "Contact - Last Contact record was not retrieved");

                // act
                if (lastRecord != null)
                {
                    lastRecord.status = "inactive";
                    lastRecord.notes += "Made Inactive on : " + DateTime.Now;
                    contactRepository.Update(lastRecord);
                    unitOfWork.Save();
                }
            }
            catch (Exception)
            {
                // assert
                Assert.Fail("Contact - Making inactive (update) failed");
                return;
            }
        }
        public async Task <ActionResult> Edit(RegistrationDataModel dataModel)
        {
            if (ModelState.IsValid)
            {
                int        id      = Convert.ToInt32(Session["UserId"]);
                TblAddress address = (from x in db.TblAddresses
                                      where x.UserId == id
                                      select x).FirstOrDefault();
                address.Line1      = dataModel.Address.Line1;
                address.Area       = dataModel.Address.Area;
                address.Province   = dataModel.Address.Province;
                address.PostalCode = dataModel.Address.PostalCode;

                await db.SaveChangesAsync();

                TblContact contact = (from x in db.TblContacts
                                      where x.UserId == id
                                      select x).FirstOrDefault();
                contact.Number = dataModel.Contact.Number;
                await db.SaveChangesAsync();

                TblUser user = (from x in db.TblUsers
                                where x.UserId == id
                                select x).FirstOrDefault();
                user.Name = dataModel.User.Name;

                await db.SaveChangesAsync();

                return(RedirectToAction("Details"));
            }
            return(View(dataModel));
        }
 public PartialViewResult Contact(TblContact p)
 {
     p.Date = DateTime.Parse(DateTime.Now.ToShortDateString());
     db.TblContact.Add(p);
     db.SaveChanges();
     return(PartialView());
 }
    /// <summary>
    /// Insertcontact - them thông tin contact
    /// </summary>
    /// <param name="contact"></param>
    /// <returns></returns>
    public bool InsertTblContact(TblContact contact)
    {
        SqlParameter[] paramList = new SqlParameter[6];

        paramList[0]       = new SqlParameter("@Creator", SqlDbType.NVarChar, 256);
        paramList[0].Value = contact.Creator;

        paramList[1]       = new SqlParameter("@Email", SqlDbType.NVarChar, 256);
        paramList[1].Value = contact.Email;

        paramList[2]       = new SqlParameter("@Phone", SqlDbType.NVarChar, 256);
        paramList[2].Value = contact.Phone;

        paramList[3]       = new SqlParameter("@Company", SqlDbType.NVarChar, 256);
        paramList[3].Value = contact.Company;

        paramList[4]       = new SqlParameter("@ContactContent", SqlDbType.NVarChar);
        paramList[4].Value = contact.ContactContent;

        paramList[5]       = new SqlParameter("@StatusId", SqlDbType.NVarChar, 256);
        paramList[5].Value = contact.StatusId;

        if (db.executeUpdate("InsertTblContact", paramList) == 0)
        {
            return(false);
        }
        else
        {
            return(true);
        }
    }
Esempio n. 7
0
        // POST: odata/Contacts
        public IHttpActionResult Post(TblContact tblContact)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Contacts.Add(tblContact);
            db.SaveChanges();

            return(Created(tblContact));
        }
Esempio n. 8
0
 public IActionResult PutTblContactToDataBase(int key, [FromBody] TblContact uContact)
 {
     if (uContact != null)
     {
         var hasData = this.repository.UpdateTblContactToDataBase(key, uContact);
         if (hasData != null)
         {
             return(new JsonResult(hasData, DefaultJsonSettings));
         }
     }
     return(new StatusCodeResult(500));
 }
Esempio n. 9
0
 public IActionResult PostTblContactToDataBase([FromBody] TblContact nContact)
 {
     if (nContact != null)
     {
         var hasData = this.repository.InsertTblContactToDataBase(nContact);
         if (hasData != null)
         {
             return(new JsonResult(hasData, DefaultJsonSettings));
         }
     }
     return(new StatusCodeResult(500));
 }
Esempio n. 10
0
        public async Task <ActionResult> Create(RegistrationDataModel registrationDataModel)
        {
            if (ModelState.IsValid)
            {
                var emails = from data in db.TblUsers select data.Email;
                foreach (string email in emails)
                {
                    if (email.Equals(registrationDataModel.Email))
                    {
                        return(Content("<script language='javascript' type='text/javascript'>alert('Email is already in use! User other Email');$.ajax({url: '/Home/Index',success: function(data) {alert(data);}});</script >"));
                    }
                }
                TblUser tblUser = new TblUser();
                tblUser.Name          = registrationDataModel.Name;
                tblUser.Email         = registrationDataModel.Email;
                tblUser.UserType      = registrationDataModel.UserType.ToString();
                tblUser.Password      = registrationDataModel.Password;
                tblUser.ValidateEmail = false;

                List <string> encryptedPasswordAndSalt = Password.Ecrypt(tblUser.Password);
                tblUser.Salt = encryptedPasswordAndSalt[0];
                tblUser.Hash = encryptedPasswordAndSalt[1];
                db.TblUsers.Add(tblUser);
                await db.SaveChangesAsync();

                int        lastGeneratedId = tblUser.UserId;
                TblAddress tblAddress      = new TblAddress();
                tblAddress.Line1      = registrationDataModel.Line1;
                tblAddress.Area       = registrationDataModel.Area;
                tblAddress.Province   = registrationDataModel.Province;
                tblAddress.PostalCode = registrationDataModel.PostalCode;
                tblAddress.UserId     = lastGeneratedId;
                tblAddress.Country    = "Canada";
                db.TblAddresses.Add(tblAddress);
                await db.SaveChangesAsync();

                TblContact tblContact = new TblContact();
                tblContact.Number = registrationDataModel.Number;
                tblContact.UserId = lastGeneratedId;
                db.TblContacts.Add(tblContact);
                await db.SaveChangesAsync();


                var sysData = from data in db.TblSysCredentials select data;
                //Send Confirmation EMail
                Email.Email.BuildEmailTemplate(tblUser.UserId, tblUser.Email, sysData.FirstOrDefault().Email, sysData.FirstOrDefault().Password);
                //BuildEmailTemplate(tblUser.UserId);
                return(RedirectToAction("Index", "Home"));
            }
            return(View());
        }
Esempio n. 11
0
        // DELETE: odata/Contacts(5)
        public IHttpActionResult Delete([FromODataUri] int key)
        {
            TblContact tblContact = db.Contacts.Find(key);

            if (tblContact == null)
            {
                return(NotFound());
            }

            db.Contacts.Remove(tblContact);
            db.SaveChanges();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 12
0
    /// <summary>
    /// Deletecontact - xoa thông tin contact
    /// </summary>
    /// <param name="contact"></param>
    /// <returns></returns>
    public bool DeleteTblContact(TblContact contact)
    {
        SqlParameter[] paramList = new SqlParameter[1];

        paramList[0]       = new SqlParameter("@ContactId", SqlDbType.Int);
        paramList[0].Value = contact.ContactId;

        if (db.executeUpdate("DeleteTblContact", paramList) == 0)
        {
            return(false);
        }
        else
        {
            return(true);
        }
    }
        public TblContact InsertTblContactToDataBase(TblContact nContact)
        {
            try
            {
                if (nContact != null)
                {
                    nContact.CreateDate = this.DateOfServer;
                    nContact.Creator    = nContact.Creator ?? "someone";

                    this.Context.TblContact.Add(nContact);
                    return(this.Context.SaveChanges() > 0 ? this.GetTblContactWithKey(nContact.ContactId) : null);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Has error " + ex.ToString());
            }
            return(null);
        }
Esempio n. 14
0
 public void TestGetByPrimaryKeyContact()
 {
     // act
     try
     {
         IList <TblContact> allRecords = contactRepository.GetAll().ToList <TblContact>();
         Assert.IsNotNull(allRecords, "");
         int        lastId     = allRecords.Max(b => b.id);
         TblContact lastRecord = allRecords.Where(b => b.id == lastId).SingleOrDefault <TblContact>();
         // assert
         Assert.IsNotNull(lastRecord, "Contact - Get by Primary key not working");
     }
     catch (Exception)
     {
         // assert
         Assert.Fail("Contact - Get By Primary Key Failed");
         return;
     }
 }
        public TblContact UpdateTblContactToDataBase(int ContactID, TblContact uContact)
        {
            try
            {
                var dbContact = this.Context.TblContact.Find(ContactID);
                if (dbContact != null)
                {
                    uContact.CreateDate = dbContact.CreateDate;
                    uContact.ModifyDate = this.DateOfServer;
                    uContact.Modifyer   = uContact.Modifyer ?? "someone";

                    this.Context.Entry(dbContact).CurrentValues.SetValues(uContact);
                    return(this.Context.SaveChanges() > 0 ? this.GetTblContactWithKey(ContactID) : null);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Has error " + ex.ToString());
            }
            return(null);
        }
        public TblContact InsertTblContactOnlyLocationToDataBase(TblLocation nContactOnlyLocation)
        {
            try
            {
                if (nContactOnlyLocation != null)
                {
                    if (this.GetTblLocations.Where(x => x.LocationName.Trim().ToLower() == nContactOnlyLocation.LocationName.Trim().ToLower()).Any())
                    {
                        return(null);
                    }

                    string LocationCode = "OZ" + ((this.GetTblLocations.Where(x => x.LocationCode.StartsWith("OZ"))?.Count() ?? 1) + 1).ToString("0");

                    var nContact = new TblContact()
                    {
                        ContactName        = "",
                        ContactPhone       = "",
                        CreateDate         = this.DateOfServer,
                        Creator            = nContactOnlyLocation.Creator ?? "someone",
                        LocationNavigation = new TblLocation()
                        {
                            CreateDate      = this.DateOfServer,
                            Creator         = nContactOnlyLocation.Creator ?? "someone",
                            LocationAddress = nContactOnlyLocation.LocationAddress,
                            LocationCode    = LocationCode,
                            LocationName    = nContactOnlyLocation.LocationName
                        }
                    };

                    this.Context.TblContact.Add(nContact);
                    return(this.Context.SaveChanges() > 0 ? this.GetTblContactWithKey(nContact.ContactId) : null);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Has error " + ex.ToString());
            }
            return(null);
        }
Esempio n. 17
0
        /// <summary>
        /// Validates user inputs
        /// </summary>
        private bool ValidateContact(TblContact contact)
        {
            bool isValid = false;

            // string emptiness validation
            isValid = GeneralValidator.IsStringNotEmpty(contact.title) &&
                      GeneralValidator.IsStringNotEmpty(contact.firstName) &&
                      GeneralValidator.IsStringNotEmpty(contact.lastName) &&
                      GeneralValidator.IsStringNotEmpty(contact.position) &&
                      GeneralValidator.IsStringNotEmpty(contact.directDial) &&
                      GeneralValidator.IsStringNotEmpty(contact.email) &&
                      GeneralValidator.IsStringNotEmpty(contact.status) &&
                      GeneralValidator.IsOneOfStringList(contact.title, new List <string>()
            {
                "Mr", "Ms", "Mrs", "Miss", "Dr"
            }) &&
                      GeneralValidator.IsOneOfStringList(contact.status, new List <string>()
            {
                "active", "inactive"
            }) &&
                      GeneralValidator.IsValidEmailAddress(contact.email);

            return(isValid);
        }
Esempio n. 18
0
        // PUT: odata/Contacts(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <TblContact> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            TblContact tblContact = db.Contacts.Find(key);

            if (tblContact == null)
            {
                return(NotFound());
            }

            patch.Put(tblContact);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TblContactExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(tblContact));
        }
Esempio n. 19
0
 /// <summary>
 /// Deletecontact - xoa thông tin contact
 /// </summary>
 /// <param name="contact"></param>
 /// <returns></returns>
 public bool DeleteTblContact(TblContact contact)
 {
     return(contactDao.DeleteTblContact(contact));
 }
Esempio n. 20
0
 /// <summary>
 /// Insertcontact - them thông tin contact
 /// </summary>
 /// <param name="contact"></param>
 /// <returns></returns>
 public bool InsertTblContact(TblContact contact)
 {
     return(contactDao.InsertTblContact(contact));
 }
Esempio n. 21
0
        public ActionResult Index(FormCollection collection)
        {
            if (collection["btnSend"] != null)
            {
                string nName    = collection["txtName"];
                string nAddress = collection["txtAddress"];
                string nMobile  = collection["txtMobile"];
                string nEmail   = collection["txtEmail"];
                string nContent = collection["txtContent"];
                string ararurl  = Request.Url.ToString();
                var    listurl  = ararurl.Split('/');
                string urlhomes = "";
                for (int i = 0; i < listurl.Length - 2; i++)
                {
                    if (i > 0)
                    {
                        urlhomes += "/" + listurl[i];
                    }
                    else
                    {
                        urlhomes += listurl[i];
                    }
                }
                TblContact TblContact = new TblContact();
                TblContact.Name    = nName;
                TblContact.Address = nAddress;
                TblContact.Mobile  = nMobile;
                TblContact.Email   = nEmail;
                TblContact.Content = nContent;
                db.TblContact.Add(TblContact);
                db.SaveChanges();

                var    config       = db.TblConfig.First();
                var    fromAddress  = config.UserEmail;
                string fromPassword = config.PassEmail;
                var    toAddress    = config.Email;
                string subject      = "Bạn có liên hệ mới từ  " + urlhomes + "";
                string chuoihtml    = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Thông tin đơn hàng</title></head><body style=\"background:#f2f2f2; font-family:Arial, Helvetica, sans-serif\"><div style=\"width:750px; height:auto; margin:5px auto; background:#FFF; border-radius:5px; overflow:hidden\">";
                chuoihtml += "<div style=\"width:100%; height:40px; float:left; margin:0px; background:#1c7fc4\"><span style=\"font-size:14px; line-height:40px; color:#FFF; margin:auto 20px; float:left\">" + DateTime.Now.Date + "</span><span style=\"font-size:14px; line-height:40px; float:right; margin:auto 20px; color:#FFF; text-transform:uppercase\">Hotline : " + config.HotlineIn + "</span></div>";
                chuoihtml += "<div style=\"width:100%; height:auto; float:left; margin:0px\"><div style=\"width:35%; height:100%; margin:0px; float:left\"><a href=\"/\" title=\"\"><img src=\"" + urlhomes + "" + config.Logo + "\" alt=\"Logo\" style=\"margin:8px; display:block; max-height:95% \" /></a></div><div style=\"width:60%; height:100%; float:right; margin:0px; text-align:right\"><span style=\"font-size:18px; margin:20px 5px 5px 5px; display:block; color:#ff5a00; text-transform:uppercase\">" + config.Name + "</span><span style=\"display:block; margin:5px; color:#515151; font-size:13px; text-transform:uppercase\">Lớn nhất - Chính hãng - Giá rẻ nhất việt nam</span> </div>  </div>";
                chuoihtml += "<span style=\"text-align:center; margin:10px auto; font-size:20px; color:#000; font-weight:bold; text-transform:uppercase; display:block\">Thông tin Liên hệ</span>";
                chuoihtml += " <div style=\"width:90%; height:auto; margin:10px auto; background:#f2f2f2; padding:15px\">";
                chuoihtml += "<p style=\"font-size:14px; color:#464646; margin:5px 20px\">Thông tin liên hệ từ website : <span style=\"color:#1c7fc4\">" + urlhomes + "</span></p>";
                chuoihtml += "<p style=\"font-size:14px; color:#464646; margin:5px 20px\">Ngày gửi liên hệ : <span style=\"color:#1c7fc4\">Vào lúc " + DateTime.Now.Hour + " giờ " + DateTime.Now.Minute + " phút ( ngày " + DateTime.Now.Day + " tháng " + DateTime.Now.Month + " năm " + DateTime.Now.Year + ") </span></p>";

                chuoihtml += "<div style=\" width:100%; margin:15px 0px\">";
                chuoihtml += "<div style=\"width:100%; height:auto; float:left; margin:0px; border:1px solid #d5d5d5\">";
                chuoihtml += "<div style=\" width:100%; height:30px; float:left; background:#1c7fc4; font-size:12px; color:#FFF; text-indent:15px; line-height:30px\">    	Thông tin người gửi     </div>";

                chuoihtml += "<div style=\"width:100%; height:auto; float:left\">";
                chuoihtml += "<p style=\"font-size:12px; margin:5px 10px\">Họ và tên :<span style=\"font-weight:bold\"> " + nName + "</span></p>";
                chuoihtml += "<p style=\"font-size:12px; margin:5px 10px\">Địa chỉ :<span style=\"font-weight:bold\"> " + nAddress + "</span></p>";
                chuoihtml += "<p style=\"font-size:12px; margin:5px 10px\">Điện thoại :<span style=\"font-weight:bold\"> " + nMobile + " </span></p>";
                chuoihtml += "<p style=\"font-size:12px; margin:5px 10px\">Email :<span style=\"font-weight:bold\">" + nEmail + "</span></p>";

                chuoihtml += "<div style=\"width:90%; height:auto; margin:10px auto; border:1px solid #d5d5d5\">";
                chuoihtml += "<div style=\" width:100%; height:30px; float:left; background:#1c7fc4; font-size:12px; color:#FFF; text-indent:15px; line-height:30px\">   	Nội dung     </div>";
                chuoihtml += " <div style=\"width:100%; height:auto; float:left\">";
                chuoihtml += "<p style=\"font-size:12px; margin:5px 10px; font-weight:bold; color:#F00\"> - " + nContent + "</p>";
                chuoihtml += "</div>";
                chuoihtml += "</div>";

                chuoihtml += "</div>";


                chuoihtml += "<div style=\"width:100%; height:auto; float:left; margin:0px\">";
                chuoihtml += "<hr style=\"width:80%; height:1px; background:#d8d8d8; margin:20px auto 10px auto\" />";
                chuoihtml += "<p style=\"font-size:12px; text-align:center; margin:5px 5px\">" + config.Address + "</p>";
                chuoihtml += "<p style=\"font-size:12px; text-align:center; margin:5px 5px\">Điện thoại : " + config.MobileIn + " - " + config.HotlineIn + "</p>";
                chuoihtml += " <p style=\"font-size:12px; text-align:center; margin:5px 5px; color:#ff7800\">Thời gian mở cửa : Từ 7h30 đến 18h30 hàng ngày (làm cả thứ 7, chủ nhật). Khách hàng đến trực tiếp xem hàng giảm thêm giá.</p>";
                chuoihtml += "</div>";
                chuoihtml += "<div style=\"clear:both\"></div>";
                chuoihtml += " </div>";
                chuoihtml += " <div style=\"width:100%; height:40px; float:left; margin:0px; background:#1c7fc4\">";
                chuoihtml += "<span style=\"font-size:12px; text-align:center; color:#FFF; line-height:40px; display:block\">Copyright (c) 2002 – 2015 SONHA VIET NAM. All Rights Reserved</span>";
                chuoihtml += " </div>";
                chuoihtml += "</div>";
                chuoihtml += "</body>";
                chuoihtml += "</html>";
                string body = chuoihtml;

                var smtp = new System.Net.Mail.SmtpClient();
                {
                    smtp.Host           = config.Host;
                    smtp.Port           = int.Parse(config.Port.ToString());
                    smtp.EnableSsl      = true;
                    smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
                    smtp.Credentials    = new NetworkCredential(fromAddress, fromPassword);
                    smtp.Timeout        = int.Parse(config.Timeout.ToString());
                }
                using (var message = new MailMessage(fromAddress, toAddress)
                {
                    Subject = subject,
                    Body = body,
                    IsBodyHtml = true,
                })
                {
                    smtp.Send(message);
                }


                Session["Status"] = "<script>$(document).ready(function(){ alert('Bạn đã đặt hàng thành công !') });</script>";
                return(RedirectToAction("Index"));
            }

            return(View());
        }
Esempio n. 22
0
 public int INSERT_CONTACT(TblContact tblCT)
 {
     return(tcd.INSERT_CONTACT(tblCT));
 }
Esempio n. 23
0
        public void GetProviderContact()
        {
            Int64 provider_id = 0;

            StreamReader stream = new StreamReader(HttpContext.Current.Request.InputStream);
            String       data   = stream.ReadToEnd();

            //data = "goal_id=1"; //testing

            String[] split_data = data.Split('=');
            if (split_data[0] == "provider_id")
            {
                provider_id = Convert.ToInt64(split_data[1]);
            }



            string            query = @"select * from tbl_contact where provider_id=" + provider_id + " order by id asc";
            List <TblContact> list  = new List <TblContact>();

            using (SqlConnection con = new SqlConnection(Global.CONN_STRING))
            {
                try
                {
                    list.Clear();

                    con.Open();

                    SqlCommand command = new SqlCommand(query, con);

                    SqlDataReader reader = command.ExecuteReader();

                    while (reader.Read())
                    {
                        TblContact item = new TblContact();

                        item.Id         = Convert.ToInt64(reader["id"].ToString().Trim());
                        item.Name       = reader["name"].ToString().Trim();
                        item.Phone      = reader["phone"].ToString().Trim();
                        item.Email      = reader["email"].ToString().Trim();
                        item.Location   = reader["location"].ToString().Trim();
                        item.Note       = reader["note"].ToString().Trim();
                        item.Type       = reader["contact_type"].ToString().Trim();
                        item.ProviderId = Convert.ToInt64(reader["provider_id"].ToString().Trim());

                        list.Add(item);
                    }

                    con.Close();

                    Global.QUERY_EXECUTION_RESP = "Success";
                }
                catch (Exception exp)
                {
                    Global.QUERY_EXECUTION_RESP = exp.Message.ToString();
                }
            }


            JavaScriptSerializer js = new JavaScriptSerializer();

            Context.Response.Write(js.Serialize(list));
        }