Ejemplo n.º 1
0
    private void Save_Options(dynamic data)
    {
        var s_options = JsonConvert.SerializeObject(data.options);

        if (string.IsNullOrWhiteSpace(s_options))
        {
            return;
        }

        CT_Service_Dep servDep = JsonConvert.DeserializeObject <CT_Service_Dep>(s_options);

        servDep.SD_AD_Code   = UserSession.DealerEmpl.DE_AD_OM_Code;
        servDep.SD_Update_dt = DateTime.Now;

        var db = DBCRMTree.GetInstance();

        if (CT_Service_Dep.Exists("SD_AD_Code = @SD_AD_Code AND SD_PDN_Code = @SD_PDN_Code", servDep))
        {
            db.Update <CT_Service_Dep>(@"SET 
            SD_SA_Selection=@SD_SA_Selection,
            SD_Serv_Package=@SD_Serv_Package,
            SD_Update_dt=@SD_Update_dt
            where SD_AD_Code = @SD_AD_Code AND SD_PDN_Code = @SD_PDN_Code", servDep);
        }
        else
        {
            servDep.Insert();
        }
    }
Ejemplo n.º 2
0
    private dynamic Get_Options(int AU_AD_Code, int SD_PDN_Code)
    {
        var servDep = new CT_Service_Dep();

        servDep = CT_Service_Dep.SingleOrDefault(@"where SD_AD_Code = @0 AND SD_PDN_Code = @1", AU_AD_Code, SD_PDN_Code);

        return(servDep);
    }
Ejemplo n.º 3
0
 private CT_Service_Dep Get_CT_Service_Dep(dynamic data)
 {
     return(CT_Service_Dep.SingleOrDefault(@"where SD_AD_Code = @0 AND SD_PDN_Code = @1",
                                           UserSession.DealerEmpl.DE_AD_OM_Code,
                                           (int)data.SD_PDN_Code));
 }