public byte[] GetUserTaskExcel(string pageNumber, string projectName, string phaseName, string userId, string fromDate, string toDate, string numberOfrecords, string userName)
        {
            ReportsDataAccess obj = new ReportsDataAccess();
            var result            = obj.GetAllUserTaskReport(pageNumber, projectName, phaseName, userId, fromDate, toDate, numberOfrecords);

            return(EnquiryBusinessLogic.ExportExcel(MapDataTableForTask(result), string.Format("User Task - {0}", userName), false, ""));
        }
        public byte[] GetCustomerExcel(int pageNumber, string searchTerm, int numberOfRecords, int rating)
        {
            CustomerDataAccess obj = new CustomerDataAccess();
            var result             = obj.GetAllCustomers(pageNumber, searchTerm, numberOfRecords, rating);

            return(EnquiryBusinessLogic.ExportExcel(MapDataTableForCustomer(result), "Customer", false, ""));
        }
Пример #3
0
        public string GetAllEnquiries(string enquiryType, int pageNumber, string searchTerm, int numberOfRecords, string fromDate, string toDate)
        {
            EnquiryBusinessLogic obj = new EnquiryBusinessLogic();
            var result = obj.GetAllEnquiries(enquiryType, pageNumber, searchTerm, numberOfRecords, fromDate, toDate, "1");
            var json   = new JavaScriptSerializer().Serialize(result);

            return(json);
        }
        public string GetAllEnquiries()
        {
            EnquiryBusinessLogic obj = new EnquiryBusinessLogic();
            var result = obj.GetEnquiryNotifications();
            var json   = new JavaScriptSerializer().Serialize(result);

            return(json);
        }
        public byte[] GetExpenseExcel(string pageNumber, string searchTerm, string category, string fromDate, string toDate, string expenseFor)
        {
            ReportsDataAccess obj = new ReportsDataAccess();
            var result            = obj.GetAllExpensesReport(1.ToString(), searchTerm, category, fromDate, toDate, expenseFor, 10000);

            string[] columns = { Convert.ToString(result.Rows[0]["TotalExpense"]) };
            return(EnquiryBusinessLogic.ExportExcel(MapDataTableForExpense(result), "Expense", false, columns));
        }
Пример #6
0
        public string GetEnquiryExcelReport(string enquiryType, int pageNumber, string searchTerm, int numberOfRecords, string fromDate, string toDate)
        {
            EnquiryBusinessLogic obj = new EnquiryBusinessLogic();
            var result    = obj.GetEnquiryExcel(enquiryType, pageNumber, searchTerm, numberOfRecords, fromDate, toDate, "1");
            var directory = HttpContext.Current.Server.MapPath("~/");
            var filename  = Path.Combine(directory, "Download", "Enquiry.xlsx");

            File.WriteAllBytes(filename, result);
            return(new JavaScriptSerializer().Serialize(filename));
        }
Пример #7
0
        private void BindEnquiryDetails(string enquiryId)
        {
            EnquiryBusinessLogic obj = new EnquiryBusinessLogic();
            var result = obj.GetEnquiryAndFollowUpbYEnquiryId(Convert.ToInt32(enquiryId));

            txtName.Text          = result.Name;
            txtContactNumber.Text = result.Phone;
            txtEmail.Text         = result.Email;
            txtAddress.InnerText  = result.Address;
        }
Пример #8
0
        private void BindEnquiryDetails(string enquiryId)
        {
            EnquiryBusinessLogic obj = new EnquiryBusinessLogic();
            var result = obj.GetEnquiryAndFollowUpbYEnquiryId(Convert.ToInt32(enquiryId));

            txtName.Text          = result.Name;
            txtContactNumber.Text = result.Phone;
            txtEmail.Text         = result.Email;
            txtAddress.InnerText  = result.Address;
            ddlCourse.Items.FindByValue(Convert.ToString(result.CourseId)).Selected = true;
        }
Пример #9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            EnquiryBusinessLogic obj = new EnquiryBusinessLogic();
            var result = obj.AddEnquiry(txtName.Text, txtContactNumber.Text, txtAddress.InnerText, txtEmail.Text, ddlResponse.Value, txtNextFollowUp.Text, txtComments.InnerText, "1", ddlCustomer.SelectedValue, ddlCourse.SelectedValue);

            if (result == true)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "SuccessRedirect", "alert('Enquiry Added Successsfully'); window.location.href = 'Enquiries.aspx';", true);
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "ErrorRedirect", "alert('Something Went wrong. Please try again later');", true);
            }
        }
Пример #10
0
        public bool AddCategory(string name)
        {
            UserModel objUser = new UserModel();
            int       userID  = 0;

            if (HttpContext.Current.Session["User"] != null)
            {
                objUser = (UserModel)Session["User"];
                userID  = objUser.UserId;
            }


            EnquiryBusinessLogic obj = new EnquiryBusinessLogic();
            var result = obj.AddCategory(name, userID);

            return(result);
        }
Пример #11
0
        public bool DeleteEnquiry(string enquiryID)
        {
            UserModel objUser = new UserModel();
            int       userID  = 0;

            if (HttpContext.Current.Session["User"] != null)
            {
                objUser = (UserModel)Session["User"];
                userID  = objUser.UserId;
            }


            EnquiryBusinessLogic obj = new EnquiryBusinessLogic();
            var result = obj.DeleteEnquiry(enquiryID, userID);

            return(result);
        }
Пример #12
0
        public string GetAllCustomers()
        {
            CustomerBusinessActions obj = new CustomerBusinessActions();
            var result = obj.GetAllCustomers(1, string.Empty, 10000, 0);
            EnquiryBusinessLogic obj1 = new EnquiryBusinessLogic();
            var enq  = obj1.GetAllEnquiries("all", 1, "", 10000, "", "").Where(x => x.ExistingCustomerId == 0).ToList();
            var cust = result.Select(x => new CustomerEnquiryComb {
                Id = x.CustomerId, Name = x.Name, Type = "C"
            }).ToList();
            var en = enq.Select(x => new CustomerEnquiryComb {
                Id = x.EnquiryId, Name = x.Name, Type = "E"
            });
            var combined = cust.Union(en);
            var json     = new JavaScriptSerializer().Serialize(combined);

            return(json);
        }
Пример #13
0
        public string GetAllEnquiries(string enquiryType, int pageNumber, string searchTerm, int numberOfRecords)
        {
            UserModel objUser  = new UserModel();
            string    centerId = "0";

            if (HttpContext.Current.Session["User"] != null)
            {
                objUser = (UserModel)Session["User"];
                if (objUser.RoleId != 1)
                {
                    centerId = objUser.CenterId.ToString();
                }
            }
            EnquiryBusinessLogic obj = new EnquiryBusinessLogic();
            var result = obj.GetAllEnquiries(enquiryType, pageNumber, searchTerm, numberOfRecords, string.Empty, string.Empty, centerId);
            var json   = new JavaScriptSerializer().Serialize(result);

            return(json);
        }
Пример #14
0
        public bool AddFollowUp(string enqID, string comment, string nextFollowUpDate, string responseType)
        {
            bool      isSuccess = false;
            UserModel objUser   = new UserModel();
            int       userID    = 0;

            if (HttpContext.Current.Session["User"] != null)
            {
                objUser = (UserModel)Session["User"];
                userID  = Convert.ToInt32(objUser.UserId);
            }

            string[] dateArray = new string[10];

            EnquiryBusinessLogic obj = new EnquiryBusinessLogic();

            isSuccess = obj.AddFollowUp(enqID, comment, nextFollowUpDate, responseType, userID);

            return(isSuccess);
        }
Пример #15
0
        private void BindData(int enquiryId)
        {
            EnquiryBusinessLogic objStudent = new EnquiryBusinessLogic();
            var studentData = objStudent.GetEnquiryAndFollowUpbYEnquiryId(enquiryId);

            if (studentData != null)
            {
                lblName.Text          = studentData.Name;
                lblAddress.Text       = studentData.Address;
                lblDateOfEnquiry.Text = studentData.EnquiryDate;
                lblEmail.Text         = studentData.Email;
                lblMobile.Text        = studentData.Phone;
                lblResponse.Text      = studentData.Response;
                lblNextFollowup.Text  = studentData.NextFollowUpDate;
                txtComments.Text      = studentData.Comments;
                if (studentData.FollowUps != null)
                {
                    grdFollowUp.DataSource = studentData.FollowUps;
                    grdFollowUp.DataBind();
                }
            }
        }