Пример #1
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();
            }
        }
Пример #2
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();
            }
        }
Пример #3
0
        public static string PostSchedule(string companyid, string nid, string empid, string clientid, string date, string time, string status, string remark, string createdby, string groupid, string projectid)
        {
            ClsTimeSheet  objts  = new ClsTimeSheet();
            DataSet       ds     = new DataSet();
            GeneralMethod objgen = new GeneralMethod();

            empTimeSheet.DataClasses.BAL.ClsScheduleBAL objsch = new empTimeSheet.DataClasses.BAL.ClsScheduleBAL();
            string result = "";

            objts.from     = date;
            objts.to       = date;
            objts.clientid = clientid;

            objts.date      = time;
            objts.hours     = time;
            objts.companyId = companyid;
            objts.CreatedBy = createdby;
            objts.empid     = empid;
            objts.projectid = projectid;
            objts.groupid   = groupid;
            objts.type      = "Field";
            objts.Status    = status;
            objts.remark    = remark;
            objts.nid       = nid;

            if (nid != "")
            {
                objts.action = "modify";
                objts.nid    = nid;
                ds           = objts.schedule();
                result       = objgen.serilizeinJson(ds.Tables[0]);
            }
            else
            {
                ds = objts.insertschedule();
                if (ds.Tables[0].Rows[0]["errormessage"].ToString() == "")
                {
                    if (ds.Tables.Count > 1)
                    {
                        if (ds.Tables[1].Rows.Count > 0)
                        {
                            if (objts.type.ToLower() != "office")
                            {
                                try
                                {
                                    objsch.sendreschedulemail(ds.Tables[1], companyid);
                                }
                                catch { }
                            }
                        }
                    }
                    result = @"[{""result"":""1"",""msg"":""""}]";
                }
                else
                {
                    result = @"[{""result"":""0"",""msg"":""" + ds.Tables[0].Rows[0]["errormessage"].ToString() + @"""}]";
                }
            }



            return(result);
        }