Пример #1
0
        public void GetExpenseCode(string EmpID, string AppLoginKey, string CompanyID)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                objts.name      = "";
                objts.action    = "select";
                objts.type      = "Expense";
                objts.companyId = CompanyID;
                objts.nid       = "";
                objts.deptID    = "";
                objts.Status    = "active";
                ds = objts.ManageTasks();

                if (ds.Tables[0].Rows.Count > 0)
                {
                    ResponseData(objGen.serilizeinJson(ds.Tables[0]));
                }
                else
                {
                    ResponseData("[]");
                }
            }
            else
            {
                ResponseError();
            }
        }
        public static string bindtasknoti(string userid, string companyid)
        {
            ClsTimeSheet objts = new ClsTimeSheet();
            DataSet      ds    = new DataSet();
            string       msg   = "";

            msg = "failure";
            try
            {
                objts.empid     = userid;
                objts.action    = "gettasknoti";
                objts.companyId = companyid;
                ds = objts.AssignTasks();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    msg = ds.Tables[0].Rows[0]["tasknoti"].ToString();
                }
                else
                {
                    msg = "";
                }
                return(msg);
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                return(msg);
            }
        }
        public static string getinvoicedetailbyinvoicenumber(string invoicenum, string companyid, string recordtype)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            GeneralMethod objgen = new GeneralMethod();
            DataSet       ds     = new DataSet();
            string        msg    = "failure";

            try
            {
                if (recordtype == "nid")
                {
                    objts.nid       = invoicenum;
                    objts.invoiceno = "";
                }
                else
                {
                    objts.nid       = "";
                    objts.invoiceno = invoicenum;
                }
                objts.companyId = companyid;
                objts.action    = "selectinvoicebynumber";
                ds  = objts.GetInvoice();
                msg = objgen.serilizeinJson(ds.Tables[0]);
                return(msg);
            }
            catch (Exception ex)
            {
                //msg = ex.Message.ToString();
                return(msg);
            }
        }
        public static string savedata(string nid, string projectid, string budgetTitle, string createdby, string companyid, string tbl, string isimport)
        {
            string result = "";
            int    status = 1;

            if (projectid == "" || budgetTitle == "")
            {
                status = 0;
                result = @"[{""result"":""0"",""msg"":""Please fill required fields""}]";
            }
            if (status == 1)
            {
                ClsTimeSheet  objda  = new ClsTimeSheet();
                DataSet       ds     = new DataSet();
                GeneralMethod objgen = new GeneralMethod();
                DataTable     dt     = new DataTable();

                dt              = objgen.deserializetoDataTable(tbl);
                objda.nid       = nid;
                objda.title     = budgetTitle;
                objda.projectid = projectid;
                objda.companyId = companyid;
                objda.CreatedBy = createdby;
                objda.Status    = isimport;
                ds              = objda.Budget_Insert(dt);
                result          = @"[{""result"":""1"",""msg"":""""}]";
            }

            return(result);
        }
        public static string resettasknotification(string userid, string companyid)
        {
            ClsTimeSheet objts = new ClsTimeSheet();
            DataSet      ds    = new DataSet();
            string       msg   = "";

            msg          = "failure";
            objts.action = "setstatusasread";
            objts.empid  = userid;
            objts.AssignTasks();
            try
            {
                objts.action    = "getcountofunreadnoti";
                objts.companyId = companyid;
                ds = objts.AssignTasks();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["numofnotification"].ToString() == "0")
                    {
                        msg = "";
                    }
                    else
                    {
                        msg = ds.Tables[0].Rows[0]["numofnotification"].ToString();
                    }
                }
                return(msg);
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                return(msg);
            }
        }
Пример #6
0
        public void DeleteSchedule(string EmpID, string AppLoginKey, string CompanyID, string nid)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                empTimeSheet.DataClasses.BAL.ClsScheduleBAL objSch = new empTimeSheet.DataClasses.BAL.ClsScheduleBAL();
                objts.nid       = nid;
                objts.action    = "deleteGRpup";
                objts.companyId = CompanyID;
                ds = objts.schedule();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ResponseData(objGen.serilizeinJson(ds.Tables[0]));
                }
                else
                {
                    ResponseData("[]");
                }
            }
            else
            {
                ResponseError();
            }
        }
        public static string selectstatus(string nid)
        {
            ClsTimeSheet objts = new ClsTimeSheet();
            DataSet      ds    = new DataSet();
            string       msg   = "failure";

            try
            {
                objts.nid = nid;

                objts.action = "selectassignmentstatus";
                ds           = objts.AssignTasks();
                if (ds.Tables[1].Rows.Count > 0)
                {
                    msg = ds.Tables[1].Rows[0]["status"].ToString();
                }
                else
                {
                    msg = "";
                }

                return(msg);
            }
            catch (Exception ex)
            {
                return(msg);
            }
        }
        public static string assign_task(string struserid, string strnid, string strempid, string strmanagerid, string strdate)
        {
            ClsTimeSheet objts = new ClsTimeSheet();
            DataSet      ds    = new DataSet();

            objts.nid       = strnid;
            objts.empid     = strempid;
            objts.hours     = strmanagerid;
            objts.date      = strdate;
            objts.CreatedBy = struserid;
            string msg = "";

            msg          = "failure";
            objts.action = "insertassigntask";
            try
            {
                ds = objts.AssignTasks();

                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        msg = ds.Tables[0].Rows[0]["employeename"].ToString().TrimEnd(',');
                    }
                }


                return(msg);
            }
            catch (Exception ex)
            {
                return(msg);
            }
        }
        public static string savestatus(string statusid, string status, string startdate, string percentage, string enddate)
        {
            ClsTimeSheet objts = new ClsTimeSheet();
            DataSet      ds    = new DataSet();

            objts.action = "updatestatus";
            objts.nid    = statusid;

            objts.eststartdate    = startdate;
            objts.completePercent = percentage;
            objts.enddate         = enddate;

            string msg = "";

            msg = "failure";
            try
            {
                ds  = objts.Manageprojectmodule();
                msg = ds.Tables[0].Rows[0]["percentage"].ToString();
                return(msg);
            }
            catch (Exception ex)
            {
                return(msg);
            }
        }
        public static StatusDetails[] getstatusdata(string nid)
        {
            ClsTimeSheet objts = new ClsTimeSheet();
            DataSet      ds    = new DataSet();

            List <StatusDetails> items = new List <StatusDetails>();

            objts.action = "selectstatus";
            objts.nid    = nid;
            ds           = objts.AssignTasks();
            string grade = "", laststatus = "";

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[1].Rows.Count > 0)
                {
                    grade      = Convert.ToString(ds.Tables[1].Rows[0]["grade"]);
                    laststatus = Convert.ToString(ds.Tables[1].Rows[0]["status"]);
                }
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    StatusDetails stdtl = new StatusDetails();
                    stdtl.nid        = ds.Tables[0].Rows[i]["nid"].ToString();
                    stdtl.statusdate = ds.Tables[0].Rows[i]["statusdate"].ToString();
                    stdtl.Status     = ds.Tables[0].Rows[i]["Status"].ToString();
                    stdtl.TimeTaken  = ds.Tables[0].Rows[i]["TimeTaken"].ToString();
                    stdtl.remark     = ds.Tables[0].Rows[i]["remark"].ToString();
                    stdtl.taskstatus = ds.Tables[0].Rows[i]["taskstatus"].ToString();
                    stdtl.grade      = grade;
                    stdtl.laststatus = laststatus;
                    items.Add(stdtl);
                }
            }
            return(items.ToArray());
        }
        public static string changeStatus(string companyid, string nid, string action, string empid, string projectid, string groupid, string newdate, string status, string remark, string createdby)
        {
            ClsTimeSheet   objts  = new ClsTimeSheet();
            DataSet        ds     = new DataSet();
            GeneralMethod  objgen = new GeneralMethod();
            ClsScheduleBAL objSch = new ClsScheduleBAL();

            objts.projectid = projectid;
            objts.groupid   = groupid;
            objts.empid     = empid;
            objts.date      = newdate;
            objts.remark    = remark;
            objts.Status    = status;
            objts.companyId = companyid;
            objts.nid       = nid;
            if (action == "one")
            {
                objts.action = "setstatus";
            }
            else
            {
                objts.action = "setgroupstatus";
            }

            ds = objts.schedule();
            string result = "";

            result = objgen.serilizeinJson(ds.Tables[0]);
            return(result);
        }
        public static Rdl.ReportItemsType CreateItems(string groupBy, string fromDate, string toDate, string billStatus, string reportName)
        {
            ClsTimeSheet objts = new ClsTimeSheet();

            // ClsConfiguration objconfi = new ClsConfiguration();
            Rdl.ReportItemsType items = new Rdl.ReportItemsType();
            items.Items = new Rdl.TextboxType[6]; //4 because we just need 4 textboxes. Name, Address and Date from Database.
            DataSet ds = new DataSet();

            objts.id       = "";
            objts.taskType = "Task";
            objts.action   = "getalltasks";
            ds             = objts.timesheetrdlcreport();
            if (ds.Tables[0].Rows.Count > 0)
            {
                items.Items[0] = CreateTableCellTextbox(ds.Tables[0].Rows[0]["companyname"].ToString(), true, 1);  //passing 1,2,3 and 4 in order to set their corresponding left,right,top,bottom and width property
                items.Items[1] = CreateTableCellTextbox(ds.Tables[0].Rows[0]["address"].ToString()
                                                        + "\n" + "Tel: " + ds.Tables[0].Rows[0]["phone"].ToString()
                                                        + "\n" + "Fax: " + ds.Tables[0].Rows[0]["fax"].ToString()
                                                        + "\n" + ds.Tables[0].Rows[0]["email"].ToString()
                                                        + "\n" + ds.Tables[0].Rows[0]["website"].ToString()
                                                        , false, 2);
                var    dateOfToday = DateTime.Now;
                string strDate     = dateOfToday.ToString("MM/dd/yyyy");
                items.Items[2] = CreateTableCellTextbox("Printed on: " + strDate, false, 3);
                items.Items[3] = CreateTableCellTextbox(reportName + "( Billable : " + billStatus + ")", true, 4); //passing 1,2,3 and 4 in order to set their
                items.Items[4] = CreateTableCellTextbox("From : " + fromDate + " To : " + toDate, true, 5);        //passing 1,2,3 and 4 in order to set their
            }
            return(items);
        }
        public static string getdetail(string selectedval)
        {
            ClsTimeSheet objts = new ClsTimeSheet();
            DataSet      ds    = new DataSet();

            string[] str = selectedval.Split('#');
            //objts.parentid = str[3];

            if (str.Length == 3)
            {
                objts.nid = "";
            }
            else
            {
                objts.nid = str[3];
            }
            string msg = "";

            msg          = "failure";
            objts.action = "selectlink";
            try
            {
                ds  = objts.Manageprojectmodule();
                msg = ds.Tables[0].Rows[0]["maintaskid"].ToString() + "###" + ds.Tables[0].Rows[0]["title"].ToString() + "###" + ds.Tables[0].Rows[0]["eststartdate"].ToString() + "###" +
                      ds.Tables[0].Rows[0]["esthours"].ToString() + "###" + ds.Tables[0].Rows[0]["description"].ToString() + "###" + ds.Tables[0].Rows[0]["percomplete"].ToString() + "###" + ds.Tables[0].Rows[0]["projectid"].ToString() + "###" + ds.Tables[0].Rows[0]["estenddate"].ToString() + "###" + ds.Tables[0].Rows[0]["chieldcount"].ToString();
                return(msg);
            }
            catch (Exception ex)
            {
                return(msg);
            }
        }
Пример #14
0
        public void GetExpenseLog(string EmpID, string AppLoginKey, string CompanyID, string fromDate, string toDate, string empNid, string projectNid)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                objts.from      = fromDate;
                objts.to        = toDate;
                objts.empid     = empNid;
                objts.action    = "select";
                objts.projectid = projectNid;
                objts.nid       = "";
                ds = objts.ManageExpenseLog();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ResponseData(objGen.serilizeinJson(ds.Tables[0]));
                }
                else
                {
                    ResponseData("[]");
                }
            }
            else
            {
                ResponseError();
            }
        }
Пример #15
0
        public static string TimesheetforDashboard(string empid, string companyid, string lastnid, string nid)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            GeneralMethod objgen = new GeneralMethod();

            DataSet ds  = new DataSet();
            string  msg = "failure";

            try
            {
                objts.action    = "select";
                objts.empid     = empid;
                objts.nid       = nid;
                objts.companyId = companyid;
                objts.id        = lastnid;
                ds  = objts.TimesheetforDashboard();
                msg = objgen.serilizeinJson(ds.Tables[0]);
                return(msg);
            }
            catch (Exception ex)
            {
                //msg = ex.Message.ToString();
                return(msg);
            }
        }
        public static string assignTask(string empid, string date, string projectid, string taskid, string companyid, string createdby, string hours, string remark, string budgethrs)
        {
            ClsTimeSheet objts = new ClsTimeSheet();
            DataSet      ds    = new DataSet();
            string       msg   = "success";

            try
            {
                objts.empid         = empid;
                objts.date          = date;
                objts.clientid      = "";
                objts.projectid     = projectid;
                objts.taskid        = taskid;
                objts.companyId     = companyid;
                objts.CreatedBy     = createdby;
                objts.hours         = hours;
                objts.nid           = "";
                objts.remark        = remark;
                objts.budgetedHours = budgethrs;
                objts.action        = "insertmultiprojecttask";
                ds  = objts.AssignTasks();
                msg = ds.Tables[0].Rows[0]["groupid"].ToString();
                return(msg);
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                return(msg);
            }
        }
Пример #17
0
        public void PostTimeSheet(string EmpID, string AppLoginKey, string CompanyID, string nid, string taskdate, string projectid, string taskid, string hours, string description, string billable, string memo, string billrate, string payrate)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                objts.companyId   = CompanyID;
                objts.nid         = "";
                objts.action      = "insert";
                objts.empid       = EmpID;
                objts.projectid   = projectid;
                objts.startdate   = taskdate;
                objts.description = description;
                objts.hours       = hours;
                objts.taskid      = taskid;
                objts.Status      = "Submitted";
                objts.isbillable  = billable;
                objts.keyword     = memo;
                objts.billrate    = billrate;
                objts.costrate    = payrate;
                objts.ManageTimesheet();


                ResponseData(@"[{""result"":""1"",""msg"":""Saved successfully""}]");
            }
            else
            {
                ResponseError();
            }
        }
Пример #18
0
        public void ModifyScheduleStatus(string EmpID, string AppLoginKey, string CompanyID, string nid, string newStatus)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                objts.projectid = "";
                objts.groupid   = "";
                objts.empid     = EmpID;
                objts.date      = "";
                objts.remark    = "";
                objts.Status    = newStatus;
                objts.companyId = CompanyID;
                objts.nid       = nid;
                objts.action    = "setgroupstatus";

                ds = objts.schedule();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ResponseData(objGen.serilizeinJson(ds.Tables[0]));
                }
                else
                {
                    ResponseData("[]");
                }
            }
            else
            {
                ResponseError();
            }
        }
Пример #19
0
        public void GetTodaySchedule(string EmpID, string AppLoginKey, string CompanyID, string TodayDate)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                empTimeSheet.DataClasses.BAL.ClsScheduleBAL objSch = new empTimeSheet.DataClasses.BAL.ClsScheduleBAL();
                objts.nid       = "";
                objts.action    = "selectgroup";
                objts.companyId = CompanyID;
                objts.from      = TodayDate;
                objts.to        = TodayDate;
                objts.clientid  = "";
                objts.projectid = "";
                objts.empid     = EmpID;
                objts.Status    = "";
                objts.remark    = "";
                ds = objts.schedule();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ResponseData(objGen.serilizeinJson(ds.Tables[0]));
                }
                else
                {
                    ResponseData("[]");
                }
            }
            else
            {
                ResponseError();
            }
        }
Пример #20
0
        public void GetMyRandomInfo(string EmpID, string AppLoginKey, string CompanyID)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                objts.empid  = EmpID;
                objts.action = "tasksummary";
                ds           = objts.Mob_MyRandonInfo();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ResponseData(objGen.serilizeinJson(ds.Tables[0]));
                }
                else
                {
                    ResponseData("[]");
                }
            }
            else
            {
                ResponseError();
            }
        }
Пример #21
0
        public void GetAllProject(string EmpID, string AppLoginKey, string CompanyID)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                objts.action    = "selectforApp";
                objts.companyId = CompanyID;
                objts.nid       = "";
                ds = objts.ManageProject();

                if (ds.Tables[0].Rows.Count > 0)
                {
                    ResponseData(objGen.serilizeinJson(ds.Tables[0]));
                }
                else
                {
                    ResponseData("[]");
                }
            }
            else
            {
                ResponseError();
            }
        }
Пример #22
0
        public void PostExpenses(string EmpID, string AppLoginKey, string CompanyID, string nid, string expDate, string projectid, string expenseid, string cost, string description, string units, string amount, string billable, string mu, string reimbursable, string memo, string companyid, string empid, string originalfile, string savedfile)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            if (checkAppKey(EmpID, AppLoginKey))
            {
                objts.empid        = empid;
                objts.projectid    = projectid;
                objts.date         = expDate;
                objts.description  = description;
                objts.units        = units;
                objts.expenseid    = expenseid;
                objts.Status       = "Submitted";
                objts.isbillable   = billable;
                objts.reimbursable = reimbursable;
                objts.remark       = memo;
                if (cost != "")
                {
                    objts.cost = cost;
                }
                else
                {
                    objts.cost = "0";
                }
                if (mu != "")
                {
                    objts.MU = mu;
                }
                else
                {
                    objts.MU = "0";
                }
                if (amount != "")
                {
                    objts.amount = amount;
                }
                else
                {
                    objts.amount = "0";
                }

                objts.originalfile = originalfile;
                objts.savedfile    = savedfile;
                objts.ManageExpenseLog();


                ResponseData(@"[{""result"":""1"",""msg"":""Saved successfully""}]");
            }
            else
            {
                ResponseError();
            }
        }
        public static string importTask(string path, string cols, string val, string companyid)
        {
            path = HttpContext.Current.Server.MapPath("webfile/temp/" + path);
            DataAccess    objda     = new DataAccess();
            ClsTimeSheet  objtax    = new ClsTimeSheet();
            DataSet       ds        = new DataSet();
            GeneralMethod objgen    = new GeneralMethod();
            ImportExcel   objimport = new ImportExcel();

            string[] cols1 = cols.Split('#');
            string[] val1  = val.Split('#');

            DataTable dt    = new DataTable();
            DataTable dtcol = new DataTable();

            dtcol.Columns.Add(new DataColumn("conval"));
            dtcol.Columns.Add(new DataColumn("colname"));


            for (int i = 0; i < cols1.Length; i++)
            {
                if (cols1[i] != "")
                {
                    DataRow ro = dtcol.NewRow();
                    ro["colname"] = cols1[i];
                    char c = Convert.ToChar(val1[i]);
                    ro["conval"] = char.ToUpper(c) - 64;
                    dtcol.Rows.Add(ro);
                }
            }


            objda.action = "8";
            ds           = objda.getImportCol();
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    dt.Columns.Add(new DataColumn(ds.Tables[0].Rows[i]["colname"].ToString()));
                }
            }
            string result = objimport.selectFromExcel(path, dt, dtcol);

            if (result == "-1")
            {
                return(result);
            }
            else
            {
                objtax.companyId = companyid;
                ds     = objtax.Budget_Import(dt);
                result = objgen.serilizeinJson(ds.Tables[0]);
                return(result);
            }
        }
Пример #24
0
        public static string savetimesheet(string nid, string title, string favnid, string taskdate, string projectid, string taskid, string hours, string description, string billable, string empid, string memo)
        {
            string msg = "";

            msg = "success";
            ClsTimeSheet objts = new ClsTimeSheet();
            DataSet      ds    = new DataSet();

            string[] favnid1  = Regex.Split(favnid, "###");
            string[] date1    = Regex.Split(taskdate, "###");
            string[] project1 = Regex.Split(projectid, "###");
            string[] task1    = Regex.Split(taskid, "###");
            string[] hours11  = Regex.Split(hours, "###");

            string[] des1      = Regex.Split(description, "###");
            string[] billable1 = Regex.Split(billable, "###");
            string[] memo1     = Regex.Split(memo, "###");



            try
            {
                objts.action = "insert";
                objts.nid    = nid;
                objts.empid  = empid;
                objts.title  = title;
                ds           = objts.manageFavoriteTasks();

                if (ds.Tables[0].Rows.Count > 0)
                {
                    objts.id = ds.Tables[0].Rows[0]["nid"].ToString();

                    objts.action = "insertdetail";
                    for (int i = 1; i < date1.Length; i++)
                    {
                        objts.nid         = favnid1[i];
                        objts.projectid   = project1[i];
                        objts.startdate   = date1[i];
                        objts.description = des1[i];
                        objts.hours       = hours11[i];
                        objts.taskid      = task1[i];

                        objts.isbillable = billable1[i];
                        objts.remark     = memo1[i];

                        objts.manageFavoriteTasks();
                    }
                }
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }
            return(msg);
        }
Пример #25
0
        public static string getassignedtask(string nid, string empid, string status, string clientid, string projectid, string taskid, string fromdate, string todate, string assignedby, string sno, string maxnid)
        {
            ClsTimeSheet objts = new ClsTimeSheet();
            GeneralMethod objgen = new GeneralMethod();
            DataSet ds = new DataSet();
            string msg = "failure";
            try
            {

                if (nid != "")
                {
                    objts.nid = nid;
                    objts.action = "selectbygroupid";
                }
                else
                {
                    objts.empid = empid;
                    objts.action = "selectbypaging";
                    objts.nid = "";
                    objts.Status = status;
                    objts.clientid = clientid;
                    objts.projectid = projectid;
                    objts.taskid = taskid;
                    objts.from = fromdate;
                    objts.to = todate;
                    objts.CreatedBy = assignedby;
                    objts.groupid = sno;
                    objts.hours = maxnid;
                }
                ds = objts.AssignTasks();
                string result = objgen.serilizeinJson(ds.Tables[0]);
                if (ds.Tables[1].Rows.Count > 0)
                {
                    int lastindex = result.LastIndexOf(']');
                    string maxid = "";
                    if (ds.Tables[1].Rows[0]["maxnid"] != null && ds.Tables[1].Rows[0]["maxnid"].ToString() != "")
                    {
                        maxid = "{\"maxnid\":" + ds.Tables[1].Rows[0]["maxnid"].ToString() + "}";
                        if (result != "[]")
                        {
                            maxid = "," + maxid;
                        }
                    }
                    result = result.Insert(lastindex, maxid);

                }
                return result;
            }
            catch (Exception ex)
            {
                return msg;
            }
        }
        public static string deleteTask(string nid, string companyid)
        {
            ClsTimeSheet  objda  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            objda.action    = "deleteTask";
            objda.nid       = nid;
            objda.companyId = companyid;
            ds = objda.Budget_Manage();
            return(objgen.serilizeinJson(ds.Tables[0]));
        }
        public static string generateemail(string companyid, string nid)
        {
            string         result = "";
            ClsTimeSheet   objts  = new ClsTimeSheet();
            DataSet        ds     = new DataSet();
            GeneralMethod  objgen = new GeneralMethod();
            ClsScheduleBAL objSch = new ClsScheduleBAL();

            objts.action    = "getDetailByGroup";
            objts.companyId = companyid;
            objts.nid       = nid;

            ds = objts.schedule();

            try
            {
                //Read File Data
                string HTMLBODY = File.Exists(HttpContext.Current.Server.MapPath("EmailTemplates/clientschedule.htm")) ? File.ReadAllText(HttpContext.Current.Server.MapPath("EmailTemplates/clientschedule.htm")) : "";

                HTMLBODY = HTMLBODY.Replace("#URL#", ds.Tables[1].Rows[0]["schedulerURL"].ToString());
                HTMLBODY = HTMLBODY.Replace("##Date##", ds.Tables[0].Rows[0]["date"].ToString() + " " + ds.Tables[0].Rows[0]["time"].ToString());
                HTMLBODY = HTMLBODY.Replace("##ClientName##", ds.Tables[0].Rows[0]["clientname"].ToString());
                HTMLBODY = HTMLBODY.Replace("##ProjectName##", ds.Tables[0].Rows[0]["projectname"].ToString());
                HTMLBODY = HTMLBODY.Replace("##ClientAddress##", ds.Tables[0].Rows[0]["clientaddress"].ToString());
                HTMLBODY = HTMLBODY.Replace("##Status##", ds.Tables[0].Rows[0]["status"].ToString());
                HTMLBODY = HTMLBODY.Replace("##CompanyContact##", ds.Tables[1].Rows[0]["phone"].ToString());
                HTMLBODY = HTMLBODY.Replace("##CompanyName##", ds.Tables[1].Rows[0]["companyname"].ToString());
                string strreceiver = "", strrecName = "";
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    if (ds.Tables[0].Rows[i]["emailid"].ToString() != "")
                    {
                        strreceiver += ds.Tables[0].Rows[i]["emailid"].ToString() + ",";
                    }
                    if ((i - 1) != ds.Tables[0].Rows.Count)
                    {
                        strrecName += ds.Tables[0].Rows[i]["fname"].ToString() + ", ";
                    }
                    else
                    {
                        strrecName += ds.Tables[0].Rows[i]["fname"].ToString();
                    }
                }
                HTMLBODY = HTMLBODY.Replace("[FirstName]", strrecName);
                result   = "1####" + strrecName + "####" + strreceiver + "####" + "Re: Schedule with - " + ds.Tables[0].Rows[0]["clientname"].ToString() + "####" + HTMLBODY;
            }
            catch (Exception ex)
            {
                result = @"0####" + ex.ToString();
            }

            return(result);
        }
Пример #28
0
        public static string DeleteFav_Task(string id)
        {
            string       str   = "success";
            ClsTimeSheet objts = new ClsTimeSheet();
            DataSet      ds    = new DataSet();

            objts.nid    = id;
            objts.action = "delete";
            ds           = objts.manageFavoriteTasks();


            return(str);
        }
        public static string getTasks(string companyid)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds1    = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            objts.action    = "getTasks";
            objts.companyId = companyid;
            ds1             = objts.Budget_Manage();

            string result = objgen.serilizeinJson(ds1.Tables[0]);

            return(result);
        }
        public static string getProject(string companyid, string clientid)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            objts.action    = "selectforautocompleter1";
            objts.companyId = companyid;
            objts.clientid  = clientid;
            ds = objts.ManageProject();
            string result = objgen.serilizeinJson(ds.Tables[0]);

            return(result);
        }