public ActionResult AddVakansiyaSave(VakansiyaModel VM, int KolChel)
        {
            if (ModelState.IsValid)
            {

                //DateTime DataObzvon = VM.DataPostVakans;
                int Status = 1;//открыта
                int? lastid = null;
                Vakans res = new Vakans()
                {
                    // VakansName = VM.VakansName,
                    idPredpr = GetIdPredpr(VM.NamePred),
                    DolgnostnObyazan = VM.DolgnObyaz,
                    InfoGrafikRab = VM.InfoGrafikRab,
                    Lgoty = VM.Lgoty,
                    DopInfo = VM.DopInfo,
                    DataPostVakans = VM.DataPostVakans,
                    DataObzvon = VM.DataPostVakans,// костыль
                    idDolznost = (int)AddDolgnost(VM.Dolgnost),
                    idStatus = Status,
                    KolChel = KolChel,
                    TrebKandidat = VM.TrebKandidat,
                    ZarPlata = VM.Zarplata,
                    OtdelName = VM.OtdelName
                };
                ugtu_db.Vakans.InsertOnSubmit(res);
                ugtu_db.SubmitChanges();
                lastid = res.idVakans;
                Param_Vakans PV = new Param_Vakans()
                    {
                        idParamZnachVakans = VM.idTipZan,
                        idParam =
                            ugtu_db.ZnachParam.Where(param => param.idZnachParam == VM.idTipZan)
                                   .Select(param => param.idParam)
                                   .First(),
                        idVakans = (int)lastid
                    };
                ugtu_db.Param_Vakans.InsertOnSubmit(PV);
                ugtu_db.SubmitChanges();
                for (int i = 0; i < VM.specs.Count(); i++)
                {
                    if (VM.specs[i].ValSpec)
                    {
                        Vakans_Specs VS = new Vakans_Specs()
                        {
                            idSpecs = VM.specs[i].idSpec,
                            idVakans = (int)lastid
                        };
                        ugtu_db.Vakans_Specs.InsertOnSubmit(VS);
                        ugtu_db.SubmitChanges();
                    }
                }

                return RedirectToAction("VakansiyaInfo", new { id = res.idVakans });
            }
            else { return RedirectToAction("AddVakansiya"); }
        }
Beispiel #2
0
        public ActionResult AddVakansiya1(string DolgnObyaz, int KolChel, string InfoGrafikRab, string Lgoty,
            string DopInfo, string VakansName, DateTime DataPostVakans, int Predpr, int Dolzhnost, int TipZan)
        {
            DateTime DataObzvon = DataPostVakans;
            int Status = 1;//открыта

            Vakans res = new Vakans()
            {
                VakansName = VakansName,
               idPredpr = Predpr,
               DolgnostnObyazan = DolgnObyaz,
               InfoGrafikRab = InfoGrafikRab,
               Lgoty = Lgoty,
               DopInfo = DopInfo,
               DataPostVakans = DataPostVakans,
               DataObzvon = DataObzvon,
               idDolznost = Dolzhnost,
               idStatus = Status,
               KolChel = KolChel
            };
              ugtu_db.Vakans.InsertOnSubmit(res);
            ugtu_db.SubmitChanges();
            var lastid = ugtu_db.Vakans.Select(vakans => vakans.idVakans).Max();
            Param_Vakans PV = new Param_Vakans()
                {
                    idParamZnachVakans = TipZan,
                    idParam =
                        ugtu_db.ZnachParam.Where(param => param.idZnachParam == TipZan)
                               .Select(param => param.idParam)
                               .First(),
                    idVakans = lastid
                };
               ugtu_db.Param_Vakans.InsertOnSubmit(PV);
            ugtu_db.SubmitChanges();

            return RedirectToAction("Vakansiya");//
        }
Beispiel #3
0
		private void detach_Vakans(Vakans entity)
		{
			this.SendPropertyChanging();
			entity.Status = null;
		}
Beispiel #4
0
		private void attach_Vakans(Vakans entity)
		{
			this.SendPropertyChanging();
			entity.Status = this;
		}
Beispiel #5
0
		private void detach_Vakans(Vakans entity)
		{
			this.SendPropertyChanging();
			entity.Predpriyatie = null;
		}
Beispiel #6
0
		private void detach_Vakans(Vakans entity)
		{
			this.SendPropertyChanging();
			entity.Dolznost = null;
		}
Beispiel #7
0
		private void attach_Vakans(Vakans entity)
		{
			this.SendPropertyChanging();
			entity.Dolznost = this;
		}
Beispiel #8
0
 partial void DeleteVakans(Vakans instance);
Beispiel #9
0
 partial void UpdateVakans(Vakans instance);
Beispiel #10
0
 partial void InsertVakans(Vakans instance);