示例#1
0
 public ActionResult CreateSubHoz(subject_hozaystva sub)
 {
     try
     {
         subhelp.AddSubHoz(
             sub.name_sub_hoz,
             sub.kod_edrpou.Value,
             sub.classificator,
             sub.kved,
             sub.urid_address,
             sub.fiz_address,
             sub.geolon.Value,
             sub.geolat.Value,
             sub.nalichie_othodov,
             sub.neobhod_razresh,
             sub.number_razr,
             sub.data_poluch_razr.Value,
             sub.data_okon_razr.Value,
             sub.neobhod_declar,
             sub.nalichie_declar,
             sub.number_dec.Value,
             sub.data_reg_dec.Value,
             sub.neobhod_interval_passport,
             sub.neobhod_reesrt_card_obj,
             sub.nalichie_reestr_card_obj,
             sub.data_for_proiz.Value,
             sub.data_for_util.Value
             );
         return(RedirectToAction("AboutSubHoz", "SubHoz"));
     }
     catch
     {
         return(View());
     }
 }
示例#2
0
        //Creaate
        public subject_hozaystva AddSubHoz(
            string subname,
            int kodedrpou,
            string classificat,
            string kvedkod,
            string uraddr,
            string fizaddr,
            float lon,
            float lat,
            string nalothod,
            string neobhrazr,
            string numbrazr,
            DateTime datapolucrazr,
            DateTime dataokonrazr,
            string neobdecl,
            string naldecl,
            int numdecl,
            DateTime datadecl,
            string neobintervalpass,
            string neobreestcardobj,
            string nalreestcardobj,
            DateTime dataproiz,
            DateTime datautil)
        {
            var d = new subject_hozaystva()
            {
                name_sub_hoz              = subname,
                kod_edrpou                = kodedrpou,
                classificator             = classificat,
                kved                      = kvedkod,
                urid_address              = uraddr,
                fiz_address               = fizaddr,
                geolon                    = lon,
                geolat                    = lat,
                nalichie_othodov          = nalothod,
                neobhod_razresh           = neobhrazr,
                number_razr               = numbrazr,
                data_poluch_razr          = datapolucrazr,
                data_okon_razr            = dataokonrazr,
                neobhod_declar            = neobdecl,
                nalichie_declar           = naldecl,
                number_dec                = numdecl,
                data_reg_dec              = datadecl,
                neobhod_interval_passport = neobintervalpass,
                neobhod_reesrt_card_obj   = neobreestcardobj,
                nalichie_reestr_card_obj  = nalreestcardobj,
                data_for_proiz            = dataproiz,
                data_for_util             = datautil
            };

            context.Add(d);
            context.SaveChanges();
            return(d);
        }