Beispiel #1
0
        //DeleteProduct

        public JobsmyaddsLD DeleteJob(JobsmyaddsD FilterData)
        {
            JobsmyaddsLD UsageD = new JobsmyaddsLD();

            try
            {
                XDocument doc = new XDocument(new XElement("Root",
                                                           new XElement("ai_job_mast_id", FilterData.EmpJobMastId)
                                                           ));

                String     XString = doc.ToString();
                PLABSM.DAL dbObj   = new PLABSM.DAL();
                if (FilterData.JobType == "JW")
                {
                    dbObj.ConnectionMode = PLABSM.ConnectionModes.WebDB;
                    DataSet ds = dbObj.SelectSP("ZA3630_Del", XString, PLABSM.DbProvider.MSSql);
                }
                else if (FilterData.JobType == "JH")
                {
                    dbObj.ConnectionMode = PLABSM.ConnectionModes.WebDB;
                    DataSet ds = dbObj.SelectSP("ZA3650_Del", XString, PLABSM.DbProvider.MSSql);
                }
                else if (FilterData.JobType == "FW")
                {
                    dbObj.ConnectionMode = PLABSM.ConnectionModes.WebDB;
                    DataSet ds = dbObj.SelectSP("ZA3670_Del", XString, PLABSM.DbProvider.MSSql);
                }
                else if (FilterData.JobType == "FH")
                {
                    dbObj.ConnectionMode = PLABSM.ConnectionModes.WebDB;
                    DataSet ds = dbObj.SelectSP("ZA3680_Del", XString, PLABSM.DbProvider.MSSql);
                }
            }
            catch (Exception e)
            {
                UsageD.UserData.ZaBase.ErrorMsg = PLWM.Utils.CnvToSentenceCase(e.Message.ToLower().Replace("plerror", "").Replace("plerror", "").Trim());
            }
            return(UsageD);
        }
Beispiel #2
0
        public JobsmyaddsLD DoInit(ZA3000D FilterData, String Mode)
        {
            JobsmyaddsLD UsageD = new JobsmyaddsLD();

            try
            {
                XDocument doc = new XDocument(new XElement("Root",
                                                           new XElement("as_mode", Mode),
                                                           new XElement("as_sessionid", FilterData.ZaBase.SessionId)
                                                           ));

                String     XString = doc.ToString();
                PLABSM.DAL dbObj   = new PLABSM.DAL();
                dbObj.ConnectionMode = PLABSM.ConnectionModes.WebDB;
                DataSet ds = dbObj.SelectSP("ZAJobList_Sel", XString, PLABSM.DbProvider.MSSql);


                System.Data.DataTable ClasifiedDt = PLWM.Utils.GetDataTable(ds, 0);
                System.Data.DataTable UserDataDt  = PLWM.Utils.GetDataTable(ds, 1);

                if (UserDataDt.Rows.Count > 0)
                {
                    UsageD.UserData = new ZA3000D()
                    {
                        FistNam = PLWM.Utils.CnvToStr(UserDataDt.Rows[0]["FirstName"]),
                        ZaBase  = new BaseD()
                        {
                            ZaKey     = Utils.GetKey(),
                            SessionId = PLWM.Utils.CnvToStr(UserDataDt.Rows[0]["SESSIONID"]),
                            ErrorMsg  = "",
                        }
                    };
                }
                else
                {
                    UsageD.UserData = new ZA3000D()
                    {
                        FistNam = "",
                        ZaBase  = new BaseD()
                        {
                            ZaKey     = Utils.GetKey(),
                            SessionId = "",
                            ErrorMsg  = "",
                        }
                    };
                }

                UsageD.JobMastCol = new JobsmyaddsDCol();
                foreach (DataRow Dr in ClasifiedDt.Rows)
                {
                    UsageD.JobMastCol.Add(new JobsmyaddsD
                    {
                        EmpJobMastId = PLWM.Utils.CnvToInt(Dr["emp_job_mast_id"]),
                        JobType      = PLWM.Utils.CnvToStr(Dr["jobtype"]),
                        Title        = PLWM.Utils.CnvToStr(Dr["title"]),
                        Descrptn     = PLWM.Utils.CnvToStr(Dr["descrptn"]),
                        Proimg       = PLWM.Utils.CnvToStr(Dr["proimg"]),
                    });
                }
            }
            catch (Exception e)
            {
                UsageD.UserData.ZaBase.ErrorMsg = PLWM.Utils.CnvToSentenceCase(e.Message.ToLower().Replace("plerror", "").Replace("plerror", "").Trim());
            }
            return(UsageD);
        }