Пример #1
0
        public List <int> GetAge(string FromDate, string sp)
        {
            List <int> list = new List <int>();
            SqlCommand cmd  = new SqlCommand(sp, BD.ConStr);

            cmd.CommandType = CommandType.StoredProcedure;

            //Add Output parameters
            cmd.Parameters.AddWithValue("@FromDate", DateTime.Parse(FromDate));
            SqlParameter AgeYears = new SqlParameter("@AgeYears", SqlDbType.Int);

            AgeYears.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(AgeYears);
            SqlParameter AgeMonths = new SqlParameter("@AgeMonths", SqlDbType.Int);

            AgeMonths.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(AgeMonths);
            SqlParameter AgeDays = new SqlParameter("@AgeDays", SqlDbType.Int);

            AgeDays.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(AgeDays);
            BD.UpdateParameters(cmd);

            list.Add((int)cmd.Parameters["@AgeYears"].Value);
            list.Add((int)cmd.Parameters["@AgeMonths"].Value);
            list.Add((int)cmd.Parameters["@AgeDays"].Value);
            return(list);
        }
Пример #2
0
        //Inserts a new course for selected PlacementID
        protected void CreateNewDrive(object sender, EventArgs e)
        {
            SqlCommand ObjCmd = new SqlCommand("spAddDrive", BD.ConStr);

            ObjCmd.CommandType = CommandType.StoredProcedure;
            ObjCmd.Parameters.AddWithValue("@DriveTitle", txtBoxDriveTitle.Text);
            ObjCmd.Parameters.AddWithValue("@EmployerID", Convert.ToInt32(ddlEmployerID.SelectedValue.ToString()));
            ObjCmd.Parameters.AddWithValue("@JobDescription", txtBoxJobDescription.Text);
            ObjCmd.Parameters.AddWithValue("@DriveDate", DateTime.Parse(txtBoxDriveDate.Text));
            ObjCmd.Parameters.AddWithValue("@CoordinatorID", Convert.ToInt32(ddlCoordinatorID.SelectedValue.ToString()));
            BD.UpdateParameters(ObjCmd);
            BD.DataBindToGridView(gvPlacementDrives, "SELECT * FROM EduSphere.PlacementDrives d JOIN EduSphere.Organizations o ON d.EmployerID=o.OrgnizationID JOIN EduSphere.Staff s ON d.CoordinatorID=s.EmployeeID", "NA");
            txtBoxDriveTitle.Text     = "";
            txtBoxJobDescription.Text = "";
        }
Пример #3
0
        //Add New Organization
        protected void AddNewOrganization(object sender, CommandEventArgs e)
        {
            SqlCommand ObjCmd = new SqlCommand("spInsertOrganization", BD.ConStr);

            ObjCmd.CommandType = CommandType.StoredProcedure;
            string strNotify = "NO";

            //if (chkBoxNotify.Checked)
            //    strNotify = "YES";
            ObjCmd.Parameters.AddWithValue("@OrganizationName", txtBoxOrganizationName.Text);
            ObjCmd.Parameters.AddWithValue("@OrganizationType", ddlOrganizationType.SelectedValue.ToString());
            ObjCmd.Parameters.AddWithValue("@ManagerName", txtBoxManagerName.Text);
            ObjCmd.Parameters.AddWithValue("@ManagerEmail", txtBoxManagerEmail.Text);
            ObjCmd.Parameters.AddWithValue("@ManagerPhone", "+91" + txtBoxManagerPhone.Text);
            ObjCmd.Parameters.AddWithValue("@ContactPerson", txtBoxContactPerson.Text);

            ObjCmd.Parameters.AddWithValue("@PhoneOne", "+91" + txtBoxPhoneTwo.Text);
            ObjCmd.Parameters.AddWithValue("@PhoneTwo", "+91" + txtBoxPhoneTwo.Text);
            ObjCmd.Parameters.AddWithValue("@Email", txtBoxEmail.Text);
            ObjCmd.Parameters.AddWithValue("@OfficeAddress", txtBoxOfficeAddress.Text);

            ObjCmd.Parameters.AddWithValue("@EnrolmentDate", DateTime.Parse(txtBoxEnrolmentDate.Text));//The first servie ID in services
            ObjCmd.Parameters.AddWithValue("@MemberPhoto", "");
            ObjCmd.Parameters.AddWithValue("@Remarks", txtBoxRemarks.Text);
            ObjCmd.Parameters.AddWithValue("@Notify", strNotify);
            ObjCmd.Parameters.AddWithValue("@street_number", street_number.Text);
            ObjCmd.Parameters.AddWithValue("@route", route.Text);
            ObjCmd.Parameters.AddWithValue("@locality", locality.Text);
            ObjCmd.Parameters.AddWithValue("@administrative_area_level_1", administrative_area_level_1.Text);
            ObjCmd.Parameters.AddWithValue("@postal_code", postal_code.Text);
            ObjCmd.Parameters.AddWithValue("@country", country.Text);
            BD.UpdateParameters(ObjCmd);
            //Response.Write("<script>alert('Member enrolled successfully')</script>");
            ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Organization Added !!!')", true);
            //Refresh View Organization List to display newly added customer.
            Response.Redirect("Organizations.aspx");
            //Display customer count
            //send Welcome Message to Organization
            //if (strNotify == "YES")
            //{
            //    Connect EC = new Connect();
            //    string strSMSmessage = string.Format("Dear '{0}, Thanks for visiting Purple Salon N Academy !!!", strFirstName);
            //    EC.SendSMS(strPhoneOne, strSMSmessage);
            //    SentMsgLogger("SMS", strSMSmessage, strPhoneOne, strFirstName);
            //}
        }
Пример #4
0
        //Indicators
        public List <int> ShowIndicatorsDashboard(DateTime IndicatorDate, int intOrganizationID)
        {
            List <int> list   = new List <int>();//list to contain all output parametrs returned values
            SqlCommand ObjCmd = new SqlCommand("spIndicators", BD.ConStr);

            ObjCmd.CommandType = CommandType.StoredProcedure;

            ObjCmd.Parameters.AddWithValue("@IndicatorDate", IndicatorDate);
            ObjCmd.Parameters.AddWithValue("@OrganizationID", intOrganizationID);
            SqlParameter TodaysServiceBills = new SqlParameter("@TodaysServiceBills", SqlDbType.Int);

            TodaysServiceBills.Direction = ParameterDirection.Output;
            ObjCmd.Parameters.Add(TodaysServiceBills);
            SqlParameter TodaysExpenseBills = new SqlParameter("@TodaysExpenseBills", SqlDbType.Int);

            TodaysExpenseBills.Direction = ParameterDirection.Output;
            ObjCmd.Parameters.Add(TodaysExpenseBills);
            SqlParameter TodaysServiceReceipts = new SqlParameter("@TodaysServiceReceipts", SqlDbType.Int);

            TodaysServiceReceipts.Direction = ParameterDirection.Output;
            ObjCmd.Parameters.Add(TodaysServiceReceipts);
            SqlParameter MonthlyServiceBills = new SqlParameter("@MonthlyServiceBills", SqlDbType.Int);

            MonthlyServiceBills.Direction = ParameterDirection.Output;
            ObjCmd.Parameters.Add(MonthlyServiceBills);
            SqlParameter MonthlyExpenseBills = new SqlParameter("@MonthlyExpenseBills", SqlDbType.Int);

            MonthlyExpenseBills.Direction = ParameterDirection.Output;
            ObjCmd.Parameters.Add(MonthlyExpenseBills);
            SqlParameter MonthlyServiceReceipts = new SqlParameter("@MonthlyServiceReceipts", SqlDbType.Int);

            MonthlyServiceReceipts.Direction = ParameterDirection.Output;
            ObjCmd.Parameters.Add(MonthlyServiceReceipts);
            BD.UpdateParameters(ObjCmd);

            list.Add((int)ObjCmd.Parameters["@TodaysServiceBills"].Value);
            list.Add((int)ObjCmd.Parameters["@TodaysExpenseBills"].Value);
            list.Add((int)ObjCmd.Parameters["@TodaysServiceReceipts"].Value);
            list.Add((int)ObjCmd.Parameters["@MonthlyServiceBills"].Value);
            list.Add((int)ObjCmd.Parameters["@MonthlyExpenseBills"].Value);
            list.Add((int)ObjCmd.Parameters["@MonthlyServiceReceipts"].Value);

            return(list);
        }
Пример #5
0
        //Add New RoleRequests
        protected void AddNewRoleRequests(object sender, CommandEventArgs e)
        {
            SqlCommand ObjCmd = new SqlCommand("spInsertRoleRequests", BD.ConStr);

            ObjCmd.CommandType = CommandType.StoredProcedure;
            ObjCmd.Parameters.AddWithValue("@ProgramId", Convert.ToInt32(ddlProgramId.SelectedValue.ToString()));
            ObjCmd.Parameters.AddWithValue("@FranchiseeID", Convert.ToInt32(ddlFranchiseeID.SelectedValue.ToString()));

            ObjCmd.Parameters.AddWithValue("@RequesterFullName", txtBoxStudentName.Text);
            ObjCmd.Parameters.AddWithValue("@Gender", ddlGender.SelectedValue.ToString());
            ObjCmd.Parameters.AddWithValue("@Education", txtBoxEducation.Text);
            ObjCmd.Parameters.AddWithValue("@Institute", txtBoxInstitute.Text);
            ObjCmd.Parameters.AddWithValue("@Stream", txtBoxStream.Text);
            ObjCmd.Parameters.AddWithValue("@RequesterEmail", txtBoxEmail.Text);
            ObjCmd.Parameters.AddWithValue("@RequesterPhone", txtBoxPhone.Text);
            ObjCmd.Parameters.AddWithValue("@RequesterState", txtBoxCity.Text);
            ObjCmd.Parameters.AddWithValue("@RequesterAddress", txtBoxState.Text);
            ObjCmd.Parameters.AddWithValue("@PinCode", txtBoxPinCode.Text);
            ObjCmd.Parameters.AddWithValue("@RoleRequestsMessage", txtBoxRoleRequestsMessage.Text);
            ObjCmd.Parameters.AddWithValue("@RaisedById", lblRaisedById.Text);
            ObjCmd.Parameters.AddWithValue("@RoleRequestsSource", txtBoxSource.Text);

            BD.UpdateParameters(ObjCmd);
            //SP.Speak("Request Registered Successfully");
            //Response.Write("<script>alert('Request Registered Successfully')</script>");
            //Alert Sound
            ScriptManager.RegisterStartupScript(this, GetType(), "makeAlertSound", "playSound()", true);
            //Refresh View RoleRequests List to display newly added RoleRequests.
            //Response.Redirect("Requests.aspx");
            txtBoxStudentName.Text = "";
            txtBoxEmail.Text       = "";
            txtBoxCity.Text        = "";
            //Display RoleRequests count
            //send Welcome Message to RoleRequests
            //if (strNotify == "YES")
            //{
            //    Connect EC = new Connect();
            //    string strSMSmessage = string.Format("Dear '{0}, Thanks for visiting Purple Salon N Academy !!!", strFirstName);
            //    EC.SendSMS(strPhoneOne, strSMSmessage);
            //    SentMsgLogger("SMS", strSMSmessage, strPhoneOne, strFirstName);
            //}
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblStaffAction.Text         = "Mark your Attendance for the Day";
                pnlViewStaff.Visible        = true;
                pnlViewStaffProfile.Visible = false;

                //Create attendatce for the day if didn't exist.
                SqlCommand cmd = new SqlCommand("spCreateAttendanceDay", BD.ConStr);
                cmd.CommandType = CommandType.StoredProcedure;
                BD.UpdateParameters(cmd);

                //Display Today Attendace Register
                DateTime AttendanceDate    = DateTime.Now;
                string   strAttendanceDate = AttendanceDate.ToString("yyyy-MM-dd");
                string   strCmd            = "";
                if (User.IsInRole("Admin"))
                {
                    strCmd = string.Format("SELECT  *,a.EmployeeId,s.FullName,s.PhoneOne,s.Email FROM EduSphere.StaffAttendance a JOIN EduSphere.Staff s ON a.EmployeeId=s.EmployeeId WHERE AttendanceDate='{0}'  ORDER BY s.FullName ASC", strAttendanceDate);
                }
                if (User.IsInRole("Manager"))
                {
                    strCmd = string.Format(@"SELECT  *,a.EmployeeId,s.FullName,s.PhoneOne,s.Email FROM EduSphere.StaffAttendance a 
                                            JOIN EduSphere.Staff s ON a.EmployeeId=s.EmployeeId 
                                            WHERE AttendanceDate='{0}' AND OrganizationID=(SELECT OrganizationId FROM EduSphere.Staff WHERE Email='{1}' )  
                                            ORDER BY s.FullName ASC", strAttendanceDate, User.Identity.Name.ToString());
                }
                if (User.IsInRole("Employee"))
                {
                    strCmd = string.Format(@"SELECT  *,a.EmployeeId,s.FullName,s.PhoneOne,s.Email FROM EduSphere.StaffAttendance a 
                                                                                                  JOIN EduSphere.Staff s ON a.EmployeeId=s.EmployeeId 
                                                      WHERE AttendanceDate='{0}' AND Email='{1}'", strAttendanceDate, User.Identity.Name.ToString());
                }

                BD.DataBindToDataList(dlStaff, strCmd);
            }
        }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //http://saketsoftail.com/new.aspx?ProgramId=%100&FranchiseeID=%100&StudentName=%Reena&Key=%SJA@123
            //string dispnumber       = Request.QueryString["dispnumber"];
            //string caller_id        = Request.QueryString["caller_id"];
            string ProgramId      = Request.Form["ProgramId"];
            string FranchiseeID   = Request.Form["FranchiseeID"];
            string StudentName    = Request.Form["StudentName"];
            string Gender         = Request.Form["Gender"];
            string Education      = Request.Form["Education"];
            string Institute      = Request.Form["Institute"];
            string Stream         = Request.Form["Stream"];
            string Phone          = Request.Form["Phone"];
            string Email          = Request.Form["Email"];
            string City           = Request.Form["City"];
            string State          = Request.Form["State"];
            string PinCode        = Request.Form["PinCode"];
            string EnquiryMessage = Request.Form["EnquiryMessage"];
            string EnquirySource  = Request.Form["EnquirySource"];
            string RaisedById     = Request.Form["RaisedById"];
            string Key            = Request.Form["Key"];



            if (Key == "SJA@123")
            {
                SqlCommand ObjCmd = new SqlCommand("spInsertEnquiry", BD.ConStr);
                ObjCmd.CommandType = System.Data.CommandType.StoredProcedure;
                ObjCmd.Parameters.AddWithValue("@ProgramId", Convert.ToInt32(ProgramId));
                ObjCmd.Parameters.AddWithValue("@FranchiseeID", Convert.ToInt32(FranchiseeID));

                ObjCmd.Parameters.AddWithValue("@StudentName", StudentName);
                ObjCmd.Parameters.AddWithValue("@Gender", Gender);
                ObjCmd.Parameters.AddWithValue("@Education", Education);
                ObjCmd.Parameters.AddWithValue("@Institute", Institute);
                ObjCmd.Parameters.AddWithValue("@Stream", Stream);
                ObjCmd.Parameters.AddWithValue("@Email", Phone);
                ObjCmd.Parameters.AddWithValue("@Phone", Email);
                ObjCmd.Parameters.AddWithValue("@City", City);
                ObjCmd.Parameters.AddWithValue("@State", State);
                ObjCmd.Parameters.AddWithValue("@PinCode", PinCode);
                ObjCmd.Parameters.AddWithValue("@EnquiryMessage", EnquiryMessage);
                ObjCmd.Parameters.AddWithValue("@RaisedById", RaisedById);
                ObjCmd.Parameters.AddWithValue("@EnquirySource", EnquirySource);
                BD.UpdateParameters(ObjCmd);
            }
        }
Пример #8
0
        //Add New Staff
        protected void AddNewStaff(object sender, CommandEventArgs e)
        {
            SqlCommand ObjCmd = new SqlCommand("spInsertStaff", BD.ConStr);

            ObjCmd.CommandType = CommandType.StoredProcedure;

            ObjCmd.Parameters.AddWithValue("@OrganizationID", ddlOrgId.SelectedValue.ToString());
            ObjCmd.Parameters.AddWithValue("@EmpPhotoPath", "~/Artifacts/Emp/Photo/Photo.jpg");
            ObjCmd.Parameters.AddWithValue("@FullName", txtBoxFullName.Text);
            ObjCmd.Parameters.AddWithValue("@Gender", ddlGender.SelectedValue.ToString());
            ObjCmd.Parameters.AddWithValue("@PhoneOne", "+91" + txtBoxPhoneOne.Text);
            ObjCmd.Parameters.AddWithValue("@PhoneTwo", "+91" + txtBoxPhoneTwo.Text);
            ObjCmd.Parameters.AddWithValue("@Email", txtBoxEmail.Text);
            ObjCmd.Parameters.AddWithValue("@ContactAddress", txtBoxContactAddress.Text);
            ObjCmd.Parameters.AddWithValue("@City", txtBoxCity.Text);
            ObjCmd.Parameters.AddWithValue("@District", txtBoxDistrict.Text);//The first servie ID in services
            ObjCmd.Parameters.AddWithValue("@PinCode", txtBoxPinCode.Text);
            ObjCmd.Parameters.AddWithValue("@State", txtBoxState.Text);
            ObjCmd.Parameters.AddWithValue("@Country", txtBoxCountry.Text);
            ObjCmd.Parameters.AddWithValue("@Designation", txtBoxDesignation.Text);
            ObjCmd.Parameters.AddWithValue("@DateOfBirth", DateTime.Parse(txtBoxDateOfBirth.Text));
            int    intManagerId = 99;
            string strManagerId = ddlManagerId.SelectedValue.ToString();

            if (strManagerId != "Select")
            {
                ObjCmd.Parameters.AddWithValue("@ManagerId", Convert.ToInt32(strManagerId));
            }
            else
            {
                ObjCmd.Parameters.AddWithValue("@ManagerId", intManagerId);
            }



            ObjCmd.Parameters.AddWithValue("@DateOfJoining", DateTime.Parse(txtBoxDateOfJoining.Text));
            ObjCmd.Parameters.AddWithValue("@EmploymentType", ddlEmploymentType.SelectedValue.ToString());
            ObjCmd.Parameters.AddWithValue("@FathersName", txtBoxFathersName.Text);
            ObjCmd.Parameters.AddWithValue("@MothersName", txtBoxMothersName.Text);
            ObjCmd.Parameters.AddWithValue("@PanNumber", txtBoxPan.Text);
            ObjCmd.Parameters.AddWithValue("@AadhaarNumber", txtBoxAadhaar.Text);
            ObjCmd.Parameters.AddWithValue("@BankName", txtBoxBankName.Text);
            ObjCmd.Parameters.AddWithValue("@BankAccountNumber", txtBoxBankAccount.Text);
            ObjCmd.Parameters.AddWithValue("@BankIFSC", txtBoxBankIFSC.Text);

            ObjCmd.Parameters.AddWithValue("@EmploymentStatus", ddlEmploymentStatus.SelectedValue.ToString());//The first servie ID in services
            if (ddlEmploymentStatus.SelectedValue.ToString() == "ACTIVE")
            {
                txtBoxDateOfLeaving.Text = "01/01/3000";
            }
            ObjCmd.Parameters.AddWithValue("@DateOfLeaving", DateTime.Parse(txtBoxDateOfLeaving.Text));

            BD.UpdateParameters(ObjCmd);
            Response.Write("<script>alert('Member enrolled successfully')</script>");
            //Refresh View Staff List to display newly added Staff.
            Response.Redirect("Staff.aspx");
            //Display Staff count
            //send Welcome Message to Staff
            //if (strNotify == "YES")
            //{
            //    Connect EC = new Connect();
            //    string strSMSmessage = string.Format("Dear '{0}, Thanks for visiting Purple Salon N Academy !!!", strFirstName);
            //    EC.SendSMS(strPhoneOne, strSMSmessage);
            //    SentMsgLogger("SMS", strSMSmessage, strPhoneOne, strFirstName);
            //}
        }