Beispiel #1
0
        public void DeleteAppointment(string EmpID, string AppLoginKey, string CompanyID, string nid)
        {
            GeneralMethod  objgen = new GeneralMethod();
            DataSet        ds     = new DataSet();
            ClsAppointment obj    = new ClsAppointment();


            if (checkAppKey(EmpID, AppLoginKey))
            {
                obj.nid    = nid;
                obj.action = "delete";
                ds         = obj.APP_ManageAppointment_new();

                if (ds.Tables[0].Rows.Count > 0)
                {
                    ResponseData(objGen.serilizeinJson(ds.Tables[0]));
                }
                else
                {
                    ResponseData("[]");
                }
            }
            else
            {
                ResponseError();
            }
        }
Beispiel #2
0
        public static string saveEmpAvailability(string nid, string empid, string aDate, string afrmDate, string aToDate)
        {
            string         msg    = "failure";
            GeneralMethod  objgen = new GeneralMethod();
            DataSet        ds     = new DataSet();
            ClsAppointment obj    = new ClsAppointment();

            string[] nid1      = nid.Split('#');
            string[] aDate1    = aDate.Split('#');
            string[] afrmDate1 = afrmDate.Split('#');
            string[] aToDate1  = aToDate.Split('#');

            try
            {
                for (int i = 0; i < aDate1.Length; i++)
                {
                    if (aDate1[i] != "")
                    {
                        obj.empid    = empid;
                        obj.aDate    = aDate1[i];
                        obj.afrmTime = afrmDate1[i];
                        obj.aToTime  = aToDate1[i];
                        obj.nid      = nid1[i];
                        obj.action   = "insert";
                        ds           = obj.APP_ManageAvailability();
                    }
                }

                msg = "1";
                return(msg);
            }
            catch { return(msg); }
        }
Beispiel #3
0
        public void ModifyAppointmentStatus(string EmpID, string AppLoginKey, string CompanyID, string nid, string newStatus)
        {
            ClsAppointment objts  = new ClsAppointment();
            DataSet        ds     = new DataSet();
            GeneralMethod  objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                objts.empid  = EmpID;
                objts.status = newStatus;
                objts.nid    = nid;
                objts.action = "setstatus";

                ds = objts.APP_ManageAppointment_new();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ResponseData(objGen.serilizeinJson(ds.Tables[1]));
                }

                else
                {
                    ResponseData("[]");
                }
            }
            else
            {
                ResponseError();
            }
        }
Beispiel #4
0
        public void GetAppointment(string EmpID, string UserType, string AppLoginKey, string CompanyID, string fromDate, string toDate, string status, string action)
        {
            ClsAppointment objts  = new ClsAppointment();
            DataSet        ds     = new DataSet();
            GeneralMethod  objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                objts.nid       = "";
                objts.action    = "selectforApp";
                objts.companyid = CompanyID;
                objts.fromdate  = fromDate;
                objts.todate    = toDate;
                objts.empid     = EmpID;
                objts.desig     = action;
                objts.status    = status;

                ds = objts.APP_ManageAppointment_new();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ResponseData(objGen.serilizeinJson(ds.Tables[0]));
                }
                else
                {
                    ResponseData("[]");
                }
            }
            else
            {
                ResponseError();
            }
        }
        public void fillemp()
        {
            DataSet        ds  = new DataSet();
            ClsAppointment obj = new ClsAppointment();

            obj.action    = "getEmployee";
            obj.companyid = app_hid_company.Value;
            ds            = obj.APP_ManageAvailability();
            dropcontactperson.DataSource     = ds;
            dropcontactperson.DataTextField  = "fullname";
            dropcontactperson.DataValueField = "nid";
            dropcontactperson.DataBind();

            dropcontactperson.Items.Insert(0, new ListItem("-Select--", ""));
        }
Beispiel #6
0
        public static string deleteAppointment(string nid)
        {
            string         msg    = "failure";
            GeneralMethod  objgen = new GeneralMethod();
            DataSet        ds     = new DataSet();
            ClsAppointment obj    = new ClsAppointment();

            try
            {
                obj.nid    = nid;
                obj.action = "delete";
                ds         = obj.APP_ManageAvailability();
                msg        = "1";
                return(msg);
            }
            catch { return(msg); }
        }
        public static string savestatus(string aDate, string frmTime, string ToTime, string status, string nid)
        {
            string         msg    = "failure";
            GeneralMethod  objgen = new GeneralMethod();
            DataSet        ds     = new DataSet();
            ClsAppointment obj    = new ClsAppointment();
            DataAccess     objda  = new DataAccess();

            try
            {
                obj.aDate    = aDate;
                obj.afrmTime = frmTime;
                obj.aToTime  = ToTime;

                obj.nid    = nid;
                obj.status = status;
                obj.action = "setstatus";
                ds         = obj.APP_ManageAppointment_new();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    try
                    {
                        string HTMLTemplatePath = HttpContext.Current.Server.MapPath("EmailTemplates/aapoitmentemail.htm");
                        string HTMLBODY         = File.Exists(HTMLTemplatePath) ? File.ReadAllText(HTMLTemplatePath) : "";
                        HTMLBODY = HTMLBODY.Replace(@"##logourl##", ds.Tables[0].Rows[0]["schedulerURL"].ToString() + "/webfile/" + ds.Tables[0].Rows[0]["logourl"].ToString());
                        HTMLBODY = HTMLBODY.Replace("##company##", ds.Tables[0].Rows[0]["companyname"].ToString());
                        HTMLBODY = HTMLBODY.Replace("##date##", ds.Tables[0].Rows[0]["adate1"].ToString() + " " + ds.Tables[0].Rows[0]["frmTime"].ToString().Replace("am", " AM").Replace("pm", " PM"));
                        HTMLBODY = HTMLBODY.Replace(" ##purpose##", ds.Tables[0].Rows[0]["service"].ToString());
                        HTMLBODY = HTMLBODY.Replace(" ##visitorname##", ds.Tables[0].Rows[0]["vName"].ToString());
                        HTMLBODY = HTMLBODY.Replace("##empname##", ds.Tables[0].Rows[0]["empname"].ToString());
                        HTMLBODY = HTMLBODY.Replace("##phone##", ds.Tables[0].Rows[0]["phone"].ToString());

                        string msg1 = objda.SendAppEmail(ds.Tables[0].Rows[0]["email"].ToString() + ",", "Confirmation Email: Appointment with " + ds.Tables[0].Rows[0]["companyname"].ToString(), HTMLBODY, ds.Tables[0].Rows[0]["empemail"].ToString() + ",", "", "", ds.Tables[0].Rows[0]["companyname"].ToString());
                        if (msg1 == "Sent")
                        {
                        }
                    }
                    catch
                    {
                    }
                }
                msg = "1";
                return(msg);
            }
            catch { return(msg); }
        }
        public static string getEmpAvailabilitybyid(string nid)
        {
            string         msg    = "failure";
            GeneralMethod  objgen = new GeneralMethod();
            DataSet        ds     = new DataSet();
            ClsAppointment obj    = new ClsAppointment();

            try
            {
                obj.action = "select";

                obj.nid = nid;


                ds  = obj.APP_ManageAvailability();
                msg = objgen.serilizeinJson(ds.Tables[0]);
                return(msg);
            }
            catch { return(msg); }
        }
        public static string getEmpAvailability(string empid)
        {
            string         msg    = "failure";
            GeneralMethod  objgen = new GeneralMethod();
            DataSet        ds     = new DataSet();
            ClsAppointment obj    = new ClsAppointment();

            try
            {
                obj.aDate = GeneralMethod.getLocalDate();

                obj.empid = empid;


                ds  = obj.APP_getAvailability();
                msg = ds.Tables[0].Rows[0][0].ToString();
                return(msg);
            }
            catch { return(msg); }
        }
        public static string getAppointments(string nid, string fromdate, string todate, string status, string companyid)
        {
            string         msg    = "failure";
            GeneralMethod  objgen = new GeneralMethod();
            DataSet        ds     = new DataSet();
            ClsAppointment obj    = new ClsAppointment();

            try
            {
                obj.fromdate  = fromdate;
                obj.todate    = todate;
                obj.companyid = companyid;
                obj.status    = status;
                obj.nid       = nid;
                obj.action    = "select";
                ds            = obj.APP_ManageAppointment_new();
                msg           = objgen.serilizeinJson(ds.Tables[0]);
                return(msg);
            }
            catch { return(msg); }
        }
Beispiel #11
0
        public static string getEmpAvailability(string empid, string compid, string fromdate, string todate)
        {
            string         msg    = "failure";
            GeneralMethod  objgen = new GeneralMethod();
            DataSet        ds     = new DataSet();
            ClsAppointment obj    = new ClsAppointment();

            try
            {
                obj.fromdate  = fromdate;
                obj.todate    = todate;
                obj.empid     = empid;
                obj.companyid = compid;
                obj.nid       = "";
                obj.action    = "select";
                ds            = obj.APP_ManageAvailability();

                msg = objgen.serilizeinJson(ds.Tables[0]);
                return(msg);
            }
            catch { return(msg); }
        }
        public static string saveEmpAvailability(string sloatid, string empid, string aDate, string frmTime, string ToTime, string vName, string designation, string company, string email, string contactno, string service)
        {
            string         msg    = "failure";
            GeneralMethod  objgen = new GeneralMethod();
            DataSet        ds     = new DataSet();
            ClsAppointment obj    = new ClsAppointment();

            DataAccess objda = new DataAccess();

            try
            {
                DateTime timetotime = new DateTime();
                string   totime;
                timetotime = Convert.ToDateTime(aDate + " " + frmTime);
                timetotime = timetotime.AddHours(1);

                totime = timetotime.ToString(@"hh:mm:ss tt", new System.Globalization.CultureInfo("en-US")).ToLower();

                obj.aDate    = aDate;
                obj.afrmTime = frmTime;

                obj.aToTime   = string.Join("", totime.Split(default(string[]), StringSplitOptions.RemoveEmptyEntries));
                obj.vname     = vName;
                obj.desig     = designation;
                obj.companyid = company;
                obj.email     = email;
                obj.contact   = contactno;
                obj.service   = service;
                obj.nid       = "";
                obj.status    = "Pending";
                obj.sloatid   = sloatid;
                obj.empid     = empid;
                obj.action    = "insert";
                ds            = obj.APP_ManageAppointment_new();

                if (ds.Tables[0].Rows.Count > 0)
                {
                    try
                    {
                        string HTMLTemplatePath = HttpContext.Current.Server.MapPath("~/EmailTemplates/appointmentReqForAdmin.htm");
                        string HTMLBODY         = File.Exists(HTMLTemplatePath) ? File.ReadAllText(HTMLTemplatePath) : "";
                        HTMLBODY = HTMLBODY.Replace(@"##logourl##", ds.Tables[0].Rows[0]["schedulerURL"].ToString() + "/webfile/" + ds.Tables[0].Rows[0]["logourl"].ToString());
                        HTMLBODY = HTMLBODY.Replace("##company##", ds.Tables[0].Rows[0]["companyname"].ToString());
                        HTMLBODY = HTMLBODY.Replace("##date##", ds.Tables[0].Rows[0]["adate1"].ToString() + " " + ds.Tables[0].Rows[0]["frmTime"].ToString().Replace("am", " AM").Replace("pm", " PM"));

                        HTMLBODY = HTMLBODY.Replace("##Date##", ds.Tables[0].Rows[0]["adate1"].ToString());
                        HTMLBODY = HTMLBODY.Replace(" ##purpose##", ds.Tables[0].Rows[0]["service"].ToString());
                        HTMLBODY = HTMLBODY.Replace(" ##visitorname##", ds.Tables[0].Rows[0]["vName"].ToString());
                        HTMLBODY = HTMLBODY.Replace("##empname##", ds.Tables[0].Rows[0]["empname"].ToString());
                        HTMLBODY = HTMLBODY.Replace("##company##", ds.Tables[0].Rows[0]["company"].ToString());
                        HTMLBODY = HTMLBODY.Replace("##email##", ds.Tables[0].Rows[0]["email"].ToString());
                        HTMLBODY = HTMLBODY.Replace("##contact##", ds.Tables[0].Rows[0]["contactno"].ToString());
                        HTMLBODY = HTMLBODY.Replace(@"##appurl##", ds.Tables[0].Rows[0]["schedulerURL"].ToString() + "/Appoint_ViewAppointments.aspx?appointmentid=" + ds.Tables[0].Rows[0]["nid"].ToString());

                        string msg1 = objda.SendAppEmail(ds.Tables[0].Rows[0]["empemail"].ToString() + ",", "New Appointment Request for Date " + ds.Tables[0].Rows[0]["adate1"].ToString(), HTMLBODY, "[email protected],", "", "", ds.Tables[0].Rows[0]["company"].ToString());
                        if (msg1 == "Sent")
                        {
                        }
                    }
                    catch
                    {
                    }
                }
                msg = "1";
                return(msg);
            }
            catch { return(msg); }
        }