Ejemplo n.º 1
0
        public ZA3650LD DoLoad(ZA3650SD FilterData, String Mode)
        {
            ZA3650LD UsageD = new ZA3650LD();

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


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

                System.Data.DataTable IndstryTypDt   = PLWM.Utils.GetDataTable(ds, 0);
                System.Data.DataTable CompnySizeDt   = PLWM.Utils.GetDataTable(ds, 1);
                System.Data.DataTable EmplymntTypeDt = PLWM.Utils.GetDataTable(ds, 2);
                System.Data.DataTable MonthlySlryDt  = PLWM.Utils.GetDataTable(ds, 3);
                System.Data.DataTable ExprnceDt      = PLWM.Utils.GetDataTable(ds, 4);
                System.Data.DataTable EductnLvlDt    = PLWM.Utils.GetDataTable(ds, 5);
                System.Data.DataTable ListedByDt     = PLWM.Utils.GetDataTable(ds, 6);
                System.Data.DataTable CareerLvlDt    = PLWM.Utils.GetDataTable(ds, 7);
                System.Data.DataTable dtUser         = PLWM.Utils.GetDataTable(ds, 8);
                System.Data.DataTable dtSel          = PLWM.Utils.GetDataTable(ds, 9);


                DataRow drUser = null;
                if (dtUser.Rows.Count > 0)
                {
                    drUser = dtUser.Rows[0];
                }

                UsageD.IndstryCol = new ZA3230DCol();
                UsageD.IndstryCol.Add(new ZA3230D()
                {
                    EmpJobDtlId = -1, EmpJobValue = "Jobs"
                });
                foreach (DataRow dr in IndstryTypDt.Rows)
                {
                    UsageD.IndstryCol.Add(new ZA3230D()
                    {
                        EmpJobDtlId = PLWM.Utils.CnvToNullableInt(dr["Emp_Job_Dtl_Id"]),
                        EmpJobValue = PLWM.Utils.CnvToStr(dr["Emp_Job_Value"]),
                    });
                }



                UsageD.CompnySizeCol = new ZA3230DCol();
                UsageD.CompnySizeCol.Add(new ZA3230D()
                {
                    EmpJobDtlId = -1, EmpJobValue = "Company Size"
                });
                foreach (DataRow dr in CompnySizeDt.Rows)
                {
                    UsageD.CompnySizeCol.Add(new ZA3230D()
                    {
                        EmpJobDtlId = PLWM.Utils.CnvToNullableInt(dr["Emp_Job_Dtl_Id"]),
                        EmpJobValue = PLWM.Utils.CnvToStr(dr["Emp_Job_Value"]),
                    });
                }

                UsageD.EmploymntTypeCol = new ZA3230DCol();
                UsageD.EmploymntTypeCol.Add(new ZA3230D()
                {
                    EmpJobDtlId = -1, EmpJobValue = "Commitment"
                });
                foreach (DataRow dr in EmplymntTypeDt.Rows)
                {
                    UsageD.EmploymntTypeCol.Add(new ZA3230D()
                    {
                        EmpJobDtlId = PLWM.Utils.CnvToNullableInt(dr["Emp_Job_Dtl_Id"]),
                        EmpJobValue = PLWM.Utils.CnvToStr(dr["Emp_Job_Value"]),
                    });
                }


                UsageD.MonthlySalaryCol = new ZA3230DCol();
                UsageD.MonthlySalaryCol.Add(new ZA3230D()
                {
                    EmpJobDtlId = -1, EmpJobValue = "Current Salary"
                });
                foreach (DataRow dr in MonthlySlryDt.Rows)
                {
                    UsageD.MonthlySalaryCol.Add(new ZA3230D()
                    {
                        EmpJobDtlId = PLWM.Utils.CnvToNullableInt(dr["Emp_Job_Dtl_Id"]),
                        EmpJobValue = PLWM.Utils.CnvToStr(dr["Emp_Job_Value"]),
                    });
                }

                UsageD.ExprnceCol = new ZA3230DCol();
                UsageD.ExprnceCol.Add(new ZA3230D()
                {
                    EmpJobDtlId = -1, EmpJobValue = "Work Experience"
                });
                foreach (DataRow dr in ExprnceDt.Rows)
                {
                    UsageD.ExprnceCol.Add(new ZA3230D()
                    {
                        EmpJobDtlId = PLWM.Utils.CnvToNullableInt(dr["Emp_Job_Dtl_Id"]),
                        EmpJobValue = PLWM.Utils.CnvToStr(dr["Emp_Job_Value"]),
                    });
                }


                UsageD.EductnLevlCol = new ZA3230DCol();
                UsageD.EductnLevlCol.Add(new ZA3230D()
                {
                    EmpJobDtlId = -1, EmpJobValue = "Education Level"
                });
                foreach (DataRow dr in EductnLvlDt.Rows)
                {
                    UsageD.EductnLevlCol.Add(new ZA3230D()
                    {
                        EmpJobDtlId = PLWM.Utils.CnvToNullableInt(dr["Emp_Job_Dtl_Id"]),
                        EmpJobValue = PLWM.Utils.CnvToStr(dr["Emp_Job_Value"]),
                    });
                }

                UsageD.ListedBycol = new ZA3230DCol();
                UsageD.ListedBycol.Add(new ZA3230D()
                {
                    EmpJobDtlId = -1, EmpJobValue = "Listed By"
                });
                foreach (DataRow dr in ListedByDt.Rows)
                {
                    UsageD.ListedBycol.Add(new ZA3230D()
                    {
                        EmpJobDtlId = PLWM.Utils.CnvToNullableInt(dr["Emp_Job_Dtl_Id"]),
                        EmpJobValue = PLWM.Utils.CnvToStr(dr["Emp_Job_Value"]),
                    });
                }

                UsageD.CareervLevelCol = new ZA3230DCol();
                UsageD.CareervLevelCol.Add(new ZA3230D()
                {
                    EmpJobDtlId = -1, EmpJobValue = "Career Level"
                });
                foreach (DataRow dr in CareerLvlDt.Rows)
                {
                    UsageD.CareervLevelCol.Add(new ZA3230D()
                    {
                        EmpJobDtlId = PLWM.Utils.CnvToNullableInt(dr["Emp_Job_Dtl_Id"]),
                        EmpJobValue = PLWM.Utils.CnvToStr(dr["Emp_Job_Value"]),
                    });
                }

                if (drUser != null)
                {
                    UsageD.UserData = new ZA3000D()
                    {
                        ZaBase = new BaseD()
                        {
                            SessionId = PLWM.Utils.CnvToStr(drUser["SessionId"]),
                            UserName  = PLWM.Utils.CnvToStr(drUser["FirstName"]),
                            ErrorMsg  = "",
                            ZaKey     = Utils.GetKey()
                        }
                    };
                }

                foreach (DataRow dr in dtSel.Rows)
                {
                    UsageD.FrelncMast = new ZA3650SD()
                    {
                        CompnyJobMastId = PLWM.Utils.CnvToInt(dr["compny_job_mast_id"]),
                        CompnyName      = PLWM.Utils.CnvToStr(dr["compny_name"]),
                        TradeLicns      = PLWM.Utils.CnvToStr(dr["trade_licns"]),
                        ContctName      = PLWM.Utils.CnvToStr(dr["contct_name"]),
                        Phone           = PLWM.Utils.CnvToStr(dr["ph_num"]),
                        CompnyWebsit    = PLWM.Utils.CnvToStr(dr["compny_websit"]),
                        Addrs           = PLWM.Utils.CnvToStr(dr["addrs"]),
                        DescrpnStepOne  = PLWM.Utils.CnvToStr(dr["descrpn_step_one"]),
                        Indstry         = UsageD.IndstryCol.FirstOrDefault(x => x.EmpJobDtlId ==
                                                                           PLWM.Utils.CnvToInt(dtSel.Rows[0]["indstry"])),
                        CompnySize = UsageD.CompnySizeCol.FirstOrDefault(x => x.EmpJobDtlId ==
                                                                         PLWM.Utils.CnvToInt(dtSel.Rows[0]["compny_size"])),

                        //StepTwo
                        JobTitle        = PLWM.Utils.CnvToStr(dr["job_title"]),
                        Neighbrhd       = PLWM.Utils.CnvToStr(dr["neighbrhd"]),
                        Location        = PLWM.Utils.CnvToStr(dr["location"]),
                        DescrptnStepTwo = PLWM.Utils.CnvToStr(dr["descrptn_step_two"]),

                        EmplymntTyp = UsageD.EmploymntTypeCol.FirstOrDefault(x => x.EmpJobDtlId ==
                                                                             PLWM.Utils.CnvToInt(dtSel.Rows[0]["emplymnt_typ"])),

                        MonthlySalary = UsageD.MonthlySalaryCol.FirstOrDefault(x => x.EmpJobDtlId ==
                                                                               PLWM.Utils.CnvToInt(dtSel.Rows[0]["monthly_salary"])),

                        Exprnce = UsageD.ExprnceCol.FirstOrDefault(x => x.EmpJobDtlId ==
                                                                   PLWM.Utils.CnvToInt(dtSel.Rows[0]["exprnce"])),

                        EductnLvl = UsageD.EductnLevlCol.FirstOrDefault(x => x.EmpJobDtlId ==
                                                                        PLWM.Utils.CnvToInt(dtSel.Rows[0]["eductn_lvl"])),

                        ListedBy = UsageD.ListedBycol.FirstOrDefault(x => x.EmpJobDtlId ==
                                                                     PLWM.Utils.CnvToInt(dtSel.Rows[0]["listed_by"])),

                        CareerLvl = UsageD.CareervLevelCol.FirstOrDefault(x => x.EmpJobDtlId ==
                                                                          PLWM.Utils.CnvToInt(dtSel.Rows[0]["career_lvl"])),
                    };
                }
            }
            catch (Exception e)
            {
                UsageD.UserData.ZaBase.ErrorMsg = PLWM.Utils.CnvToSentenceCase(e.Message.ToLower().Replace("plerror", "").Replace("plerror", "").Trim());
            }

            return(UsageD);
        }
Ejemplo n.º 2
0
        public ZA3650LD DoLoadFrelncList(ZA3650LD FilterData, String Mode)
        {
            ZA3650LD UsageD = new ZA3650LD();

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

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

                System.Data.DataTable UserDt      = PLWM.Utils.GetDataTable(ds, 0);
                System.Data.DataTable FrelncColDt = PLWM.Utils.GetDataTable(ds, 1);
                System.Data.DataTable PageNoDt    = PLWM.Utils.GetDataTable(ds, 2);

                if (UserDt.Rows.Count > 0)
                {
                    UsageD.UserData = new ZA3000D()
                    {
                        UsrMastID = PLWM.Utils.CnvToInt(UserDt.Rows[0]["usr_mast_id"]),
                        FistNam   = PLWM.Utils.CnvToStr(UserDt.Rows[0]["FirstName"]),
                        ZaBase    = new BaseD()
                        {
                            SessionId = PLWM.Utils.CnvToStr(UserDt.Rows[0]["SESSIONID"]),
                        },
                    };
                }

                foreach (DataRow dr in FrelncColDt.Rows)
                {
                    UsageD.ComCol.Add(new ZA3650SD()
                    {
                        CompnyJobMastId = PLWM.Utils.CnvToInt(dr["frelnc_comp_job_mast_id"]),
                        CompnyName      = PLWM.Utils.CnvToStr(dr["comp_name"]),
                        JobTitle        = PLWM.Utils.CnvToStr(dr["Title"]),
                        CrtdDt          = PLWM.Utils.CnvToStr(dr["crtd_dt"]),
                        Location        = PLWM.Utils.CnvToStr(dr["location"]),
                        DescrpnStepOne  = PLWM.Utils.CnvToStr(dr["descrpn"]),
                    });
                }
                UsageD.PageNoCol = new ComDisValDCol();
                foreach (DataRow Dr in PageNoDt.Rows)
                {
                    UsageD.PageNoCol.Add(new ComDisValD()
                    {
                        ValMembr    = PLWM.Utils.CnvToInt(Dr["TotalPages"]),
                        DisPlyMembr = PLWM.Utils.CnvToStr(Dr["Page_No"]),
                    });
                }
                UsageD.ReportypCol.Add(new ComDisValD()
                {
                    DisPlyMembr = "Hiring",
                    ValMembr    = 0
                });

                UsageD.ReportypCol.Add(new ComDisValD()
                {
                    DisPlyMembr = "Jobs Wanted",
                    ValMembr    = 1
                });
            }
            catch (Exception e)
            {
                UsageD.UserData.ZaBase.ErrorMsg = PLWM.Utils.CnvToSentenceCase(e.Message.ToLower().Replace("plerror", "").Replace("plerror", "").Trim());
            }
            return(UsageD);
        }