Beispiel #1
0
        public ZA3011LD DoLoadA(ZA3011D FilterData, String Mode)
        {
            ZA3011LD SaveDataV = new ZA3011LD();

            try
            {
                XDocument doc = new XDocument(new XElement("Root",
                                                           //new XElement("as_mode", Mode),
                                                           new XElement("as_sessionid", FilterData.UserData.ZaBase.SessionId),
                                                           new XElement("ai_pack_deal_mast_id", FilterData.PackDealMastId),
                                                           new XElement("ai_deal_mast_id", FilterData.DealMastId),
                                                           new XElement("as_mode", Mode)
                                                           ));


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

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

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

                foreach (DataRow dr in DealcolDt.Rows)
                {
                    SaveDataV.Dealcol.Add(new ZA3011D()
                    {
                        DealMastId     = PLWM.Utils.CnvToInt(dr["deal_mast_id"]),
                        PackDealMastId = PLWM.Utils.CnvToInt(dr["pack_deal_mast_id"]),
                        DealName       = PLWM.Utils.CnvToStr(dr["deal_name"]),
                        Price          = PLWM.Utils.CnvToStr(dr["price"]),
                        StartDt        = PLWM.Utils.CnvToStr(dr["start_dt"]),
                        EndDt          = PLWM.Utils.CnvToStr(dr["end_dt"]),
                        Descrptn       = PLWM.Utils.CnvToStr(dr["descrptn"]),
                    });
                }
            }
            catch (Exception e)
            {
                SaveDataV.UserData.ZaBase.ErrorMsg = PLWM.Utils.CnvToSentenceCase(e.Message.ToLower().Replace("plerror", "").Replace("plerror", "").Trim());
            }
            return(SaveDataV);
        }
Beispiel #2
0
        public ZA3011D DoSave(ZA3011D FilterData, String Mode)
        {
            ZA3011D SaveDataV = new ZA3011D();

            if (FilterData.DealMastId > 0)
            {
                Mode = "U";
            }
            try
            {
                XDocument doc = new XDocument(new XElement("Root",
                                                           new XElement("as_mode", Mode),
                                                           new XElement("as_sessionid", FilterData.UserData.ZaBase.SessionId),
                                                           new XElement("ai_packdeal_mast_id", FilterData.PackDealMastId),
                                                           new XElement("ai_deal_mast_id", FilterData.DealMastId),
                                                           new XElement("as_deal_name", FilterData.DealName),
                                                           new XElement("an_price", FilterData.Price),
                                                           new XElement("as_descrptn", FilterData.Descrptn),
                                                           new XElement("ad_start_dt", FilterData.StartDt),
                                                           new XElement("ad_end_dt", FilterData.EndDt)
                                                           ));


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


                System.Data.DataTable dtComn = PLWM.Utils.GetDataTable(ds, 0);
                if (dtComn.Rows.Count > 0)
                {
                    SaveDataV.DealName = PLWM.Utils.CnvToStr(dtComn.Rows[0]["deal_name"]);
                    SaveDataV.Price    = PLWM.Utils.CnvToStr(dtComn.Rows[0]["price"]);
                    SaveDataV.Descrptn = PLWM.Utils.CnvToStr(dtComn.Rows[0]["descrptn"]);
                    SaveDataV.StartDt  = PLWM.Utils.CnvToStr(dtComn.Rows[0]["start_dt"]);
                    SaveDataV.EndDt    = PLWM.Utils.CnvToStr(dtComn.Rows[0]["end_dt"]);
                }
            }
            catch (Exception e)
            {
                SaveDataV.UserData.ZaBase.ErrorMsg = PLWM.Utils.CnvToSentenceCase(e.Message.ToLower().Replace("plerror", "").Replace("plerror", "").Trim());
            }

            return(SaveDataV);
        }
Beispiel #3
0
        public ZA3011LD DoDelete(ZA3011D FilterData, String Mode)
        {
            ZA3011LD SaveDataV = new ZA3011LD();

            try
            {
                XDocument doc = new XDocument(new XElement("Root",
                                                           new XElement("as_sessionid", FilterData.UserData.ZaBase.SessionId),
                                                           new XElement("ai_deal_mast_id", FilterData.DealMastId)
                                                           ));
                String     XString = doc.ToString();
                PLABSM.DAL dbObj   = new PLABSM.DAL();
                dbObj.ConnectionMode = PLABSM.ConnectionModes.WebDB;
                DataSet ds = dbObj.SelectSP("ZA3011_DEL", XString, PLABSM.DbProvider.MSSql);
            }
            catch (Exception e)
            {
                SaveDataV.UserData.ZaBase.ErrorMsg = PLWM.Utils.CnvToSentenceCase(e.Message.ToLower().Replace("plerror", "").Replace("plerror", "").Trim());
            }
            return(SaveDataV);
        }