Exemple #1
0
        public Command(
			DDD.ATM.Bus.ICommandRouter commandRouter)
        {
            // TODO: BS 19/02/2012 DBC checks

            this.c_commandRouter = commandRouter;
        }
        public LoginPresenter(
			DDD.ATM.UI.Views.ILoginForm view,
			DDD.ATM.Bus.ICommand commandBus)
        {
            this.c_view = view;
            this.c_commandBus = commandBus;
        }
 // POST api/<controller>
 public void Post([FromBody]Form newForm)
 {
     using (var db = new DDD())
     {
         db.Forms.Add(newForm);
         db.SaveChanges();
     }
 }
 // PUT api/<controller>/5
 public void Put(int id, [FromBody]Form newForm)
 {
     using (var db = new DDD())
     {
         var form = db.Forms.First(f => f.Id == id);
         form.name = newForm.name;
         db.SaveChanges();
     }
 }
 // DELETE api/<controller>/5
 public void Delete(int id)
 {
     using (var db = new DDD())
     {
         var form = db.Forms.First(f => f.Id == id);
         db.Forms.Remove(form);
         db.SaveChanges();
     }
 }
Exemple #6
0
        protected override int GetHashCodeCore()
        {
            unchecked
            {
                var hashCode = Numero.GetHashCode();
                hashCode = (hashCode * 397) ^ DDD.GetHashCode();

                return(hashCode);
            }
        }
 public Telefone ConvertyToEntity()
 {
     return(new Telefone
     {
         DDD = DDD == null ? null : DDD.Trim(),
         Numero = Numero == null ? null : Numero.Trim(),
         Status = true,
         TipoTelefoneId = TipoTelefoneId
     });
 }
 // GET api/<controller>/5
 public Form Get(int id)
 {
     using (var db = new DDD())
     {
         var form = db.Forms.First(f => f.Id == id);
         var ff = new Form();
         ff.name = form.name;
         ff.Id = form.Id;
         return ff;
     }
 }
Exemple #9
0
 // GET api/<controller>/5
 public Form Get(int id)
 {
     using (var db = new DDD())
     {
         var form = db.Forms.First(f => f.Id == id);
         var ff   = new Form();
         ff.name = form.name;
         ff.Id   = form.Id;
         return(ff);
     }
 }
Exemple #10
0
 public ActionResult Add(DDD ddd)
 {
     try
     {
         _DDDService.Add(ddd);
         return(Created("api/ddds", ddd));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.ToString()));
     }
 }
Exemple #11
0
        public void DDDService_Add_Return_Be_Sucess()
        {
            var ddd = new DDD
            {
                Id     = 1,
                Codigo = "011"
            };

            _serviceMock.Add(ddd);

            _dddRepository.Verify(r => r.Add(
                                      It.Is <DDD>(v => v.Codigo == ddd.Codigo)));
        }
Exemple #12
0
        public void DDD_Save_Changes_Is_Called()
        {
            var ddd = new DDD
            {
                Id     = 1,
                Codigo = "011"
            };

            _dddRepository.Add(ddd);
            var retorno = _dddRepository.GetById(1);

            //Assert
            Assert.NotNull(retorno);
            Assert.IsAssignableFrom <DDD>(retorno);
        }
        public void Execute(
			DDD.ATM.Commands.CustomerAttemptingLogin cancelReportStolenBankCardCommand)
        {
            Console.WriteLine("Got to here");

            // TODO; BS 19/02/2012 Pending questions
            // Now need to answer a few questions...
            // Firstly, do I go through an "aggregate root to perform this operation?
            // Or do I go straight to the event store

            // I am assuming I must execute some method that is associated with an aggregate root where the
            // commands corresponding event generated will be stored

            // Where will the chack against the event store occur to see if the customer exists or not

            // Is there a customer aggregate root?
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                using (sqlCon)
                {
                    SqlCommand sqlCmd = new SqlCommand("Select VisitReasonID, VisitReasonName from VisitReason", sqlCon);
                    sqlCon.Open();
                    DDrea.DataTextField  = "VisitReasonName";
                    DDrea.DataValueField = "VisitReasonID";
                    DDrea.DataSource     = sqlCmd.ExecuteReader();
                    DDrea.DataBind();
                    sqlCon.Close();

                    SqlCommand sqlCmd1 = new SqlCommand("Select TimeSlotID, TimeSlot from TimeSlot", sqlCon);
                    sqlCon.Open();
                    DDtime.DataTextField  = "TimeSlot";
                    DDtime.DataValueField = "TimeSlotID";
                    DDtime.DataSource     = sqlCmd1.ExecuteReader();
                    DDtime.DataBind();
                    sqlCon.Close();

                    SqlCommand sqlCmd2 = new SqlCommand("Select OfficeID, OfficeName from Offices", sqlCon);
                    sqlCon.Open();
                    DDloc.DataTextField  = "OfficeName";
                    DDloc.DataValueField = "OfficeID";
                    DDloc.DataSource     = sqlCmd2.ExecuteReader();
                    DDloc.DataBind();
                    sqlCon.Close();

                    SqlCommand sqlCmd3 = new SqlCommand("Select Fname, LName, DoctorID from Doctors where DoctorTypeID =1", sqlCon);
                    sqlCon.Open();
                    DDD.DataTextField  = "LName";
                    DDD.DataValueField = "DoctorID";
                    DDD.DataSource     = sqlCmd3.ExecuteReader();
                    DDD.DataBind();
                    sqlCon.Close();



                    LaReq.Visible  = false;
                    Label8.Visible = false;
                }
            }
        }
Exemple #15
0
        // GET api/<controller>
        public IEnumerable <Form> Get()
        {
            List <Form> forms = new List <Form>();

            using (var db = new DDD())
            {
                var fs = from f in db.Forms select f;
                foreach (Form ff in fs)
                {
                    Form form = new Form();
                    form.name = ff.name;
                    form.Id   = ff.Id;
                    forms.Add(form);
                }
            }

            return(forms);
//            return new Form[] { new Form(), new Form() };
        }
Exemple #16
0
        // GET api/<controller>
        public IEnumerable<Form> Get()
        {
            List<Form> forms = new List<Form>();

            using (var db = new DDD())
            {
                var fs = from f in db.Forms select f;
                foreach (Form ff in fs)
                {
                    Form form = new Form();
                    form.name = ff.name;
                    form.Id = ff.Id;
                    forms.Add(form);
                }
            }

            return forms;
            //            return new Form[] { new Form(), new Form() };
        }
        public IEnumerable <Plano> GetByTipo(string ddd, TipoPlano tipo)
        {
            try
            {
                DDD dDD = ((TelefoniaContext)Context).DDDs.Where(x => x.Sigla == ddd).First();
                if (ddd is null)
                {
                    return(null);
                }

                return(((TelefoniaContext)Context).Planos.Where(x => x.DDDPlanos.Any(y => y.DDDId == dDD.Id))
                       .Where(z => z.Tipo == tipo)
                       .Include(x => x.DDDPlanos)
                       .ThenInclude(y => y.Ddd));
            }
            catch
            {
                return(null);
            }
        }
        public IEnumerable <Plano> GetByPlano(string ddd, string plano)
        {
            try
            {
                DDD dDD = ((TelefoniaContext)Context).DDDs.Where(x => x.Sigla == ddd).First();
                if (ddd is null)
                {
                    return(null);
                }

                return(((TelefoniaContext)Context).Planos.Where(x => x.DDDPlanos.Any(y => y.DDDId == dDD.Id))
                       .Where(z => z.Codigo.ToLower() == plano.ToLower())
                       .Include(x => x.DDDPlanos)
                       .ThenInclude(y => y.Ddd));
            }
            catch
            {
                return(null);
            }
        }
Exemple #19
0
        public async Task Post_Returns_Created_Response()
        {
            var ddd = new DDD
            {
                Codigo = "027"
            };

            HttpContent httpContent = new StringContent(JsonConvert.SerializeObject(ddd), Encoding.UTF8);

            httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");

            var postRequest = new HttpRequestMessage(HttpMethod.Post, "/api/ddds");

            postRequest.Content = httpContent;

            var response = await _client.SendAsync(postRequest);

            response.EnsureSuccessStatusCode();
            response.StatusCode.Should().Be(HttpStatusCode.Created);
        }
        private void BindDDDs()
        {
            var ddd1 = new DDD
            {
                Id     = 1,
                Codigo = "011"
            };
            var ddd2 = new DDD
            {
                Id     = 2,
                Codigo = "016"
            };
            var ddd3 = new DDD
            {
                Id     = 2,
                Codigo = "016"
            };

            _dddServiceMock.Setup(x => x.GetById(1)).Returns(ddd1);
            _dddServiceMock.Setup(x => x.GetById(2)).Returns(ddd2);
            _dddServiceMock.Setup(x => x.GetById(3)).Returns(ddd3);
        }
Exemple #21
0
        private void Lost_Month(object sender, RoutedEventArgs e)
        {
            if (作成月 == null)
            {
                string   Date;
                int      iDate;
                DateTime MM;
                MM    = DateTime.Today;
                Date  = Convert.ToString(MM);
                Date  = Date.Substring(5, 2);
                iDate = Convert.ToInt32(Date);
                作成月   = iDate.ToString();
            }
            else
            {
                int?換月 = -1;
                if (!string.IsNullOrEmpty(作成月))
                {
                    換月 = AppCommon.IntParse(作成月);
                }
                //再入力処理
                if (換月 == 0)
                {
                    string   Date;
                    int      iDate;
                    DateTime MM;
                    MM    = DateTime.Today;
                    Date  = Convert.ToString(MM);
                    Date  = Date.Substring(5, 2);
                    iDate = Convert.ToInt32(Date);
                    作成月   = iDate.ToString();
                }
                //再入力時のエラー処理
                //初期値0ではエラー処理が通らないので-1をセット
                if (換月 < 1 || 換月 > 12)
                {
                    if (換月 == -1)
                    {
                        string   Date;
                        int      iDate;
                        DateTime MM;
                        MM    = DateTime.Today;
                        Date  = Convert.ToString(MM);
                        Date  = Date.Substring(5, 2);
                        iDate = Convert.ToInt32(Date);
                        作成月   = iDate.ToString();
                    }
                }
            }

            if (!string.IsNullOrEmpty(作成締日))
            {
                //締日入力時
                //メソッドで期間計算
                DateFromTo ret = AppCommon.GetDateFromTo(Convert.ToInt32(作成年), Convert.ToInt32(作成月), Convert.ToInt32(作成締日));
                if (ret.Result == false || ret.Kikan > 31)
                {
                    this.ErrorMessage = "入力値エラーです。もう一度入力してください。";
                    MessageBox.Show("入力値エラーです。もう一度入力してください。");
                    作成月 = null;
                    SetFocusToTopControl();
                    return;
                }
                集計期間From = ret.DATEFrom;
                集計期間To   = ret.DATETo;
            }
            else
            {
                //全締日選択時 例外処理
                int?全締日時作成月 = 0;

                if (作成月 != null)
                {
                    全締日時作成月 = AppCommon.IntParse(作成月);
                    if (全締日時作成月 < 1 || 全締日時作成月 > 12)
                    {
                        this.ErrorMessage = "入力値エラーです。もう一度入力してください。";
                        MessageBox.Show("入力値エラーです。もう一度入力してください。");
                        作成月 = null;
                        SetFocusToTopControl();
                        return;
                    }
                }

                //全締日選択時
                string   Date = 作成年.ToString() + "/" + 全締日時作成月 + "/" + "01";
                DateTime YYY, DDD;
                YYY      = Convert.ToDateTime(Date);
                DDD      = Convert.ToDateTime(Date);
                DDD      = DDD.AddMonths(+1).AddDays(-1);
                集計期間From = YYY;
                集計期間To   = DDD;
            }

            //集計年月を作成
            Encoding sjisEnc = Encoding.GetEncoding("Shift_JIS");
            int      num     = sjisEnc.GetByteCount(作成月);

            if (!string.IsNullOrEmpty(作成締日))
            {
                int?p変換作成締日 = AppCommon.IntParse(作成締日);

                //文字のバイト数が1の場合、月に0を足して表示
                if (num == 1)
                {
                    集計年月 = Convert.ToInt32(作成年 + "0" + 作成月);
                }
                else
                {
                    集計年月 = Convert.ToInt32(作成年 + 作成月);
                }
            }
            else
            {
                //文字のバイト数が1の場合、月に0を足して表示
                if (num == 1)
                {
                    集計年月 = Convert.ToInt32(作成年 + "0" + 作成月);
                }
                else
                {
                    集計年月 = Convert.ToInt32(作成年 + 作成月);
                }
            }
        }
Exemple #22
0
 public IEnumerable <DDD> Filtros(DDD obj)
 {
     return(_dddRepository.Filtros(obj));
 }
Exemple #23
0
        //作成月がNullの場合は今月の月を挿入
        private void Lost_Month(object sender, RoutedEventArgs e)
        {
            if (作成月 == null)
            {
                string   Date;
                int      iDate;
                DateTime MM;
                MM    = DateTime.Today;
                Date  = Convert.ToString(MM);
                Date  = Date.Substring(5, 2);
                iDate = Convert.ToInt32(Date);
                作成月   = iDate.ToString();
            }
            else
            {
                int?換月 = -1;
                if (!string.IsNullOrEmpty(作成月))
                {
                    換月 = AppCommon.IntParse(作成月);
                }
                //再入力処理
                if (換月 == 0)
                {
                    string   Date;
                    int      iDate;
                    DateTime MM;
                    MM    = DateTime.Today;
                    Date  = Convert.ToString(MM);
                    Date  = Date.Substring(5, 2);
                    iDate = Convert.ToInt32(Date);
                    作成月   = iDate.ToString();
                }
                //再入力時のエラー処理
                //初期値0ではエラー処理が通らないので-1をセット
                if (換月 < 1 || 換月 > 12)
                {
                    if (換月 == -1)
                    {
                        string   Date;
                        int      iDate;
                        DateTime MM;
                        MM    = DateTime.Today;
                        Date  = Convert.ToString(MM);
                        Date  = Date.Substring(5, 2);
                        iDate = Convert.ToInt32(Date);
                        作成月   = iDate.ToString();
                    }
                }
            }

            if (!string.IsNullOrEmpty(作成締日))
            {
                //締日入力時
                //メソッドで期間計算
                DateFromTo ret = AppCommon.GetDateFromTo(Convert.ToInt32(作成年), Convert.ToInt32(作成月), Convert.ToInt32(作成締日));
                if (ret.Result == false || ret.Kikan > 31)
                {
                    this.ErrorMessage = "入力値エラーです。もう一度入力してください。";
                    MessageBox.Show("入力値エラーです。もう一度入力してください。");
                    SetFocusToTopControl();
                    return;
                }
                集計期間From = ret.DATEFrom;
                集計期間To   = ret.DATETo;
            }
            else
            {
                //全締日選択時
                string   Date = 作成年.ToString() + "/" + 作成月.ToString() + "/" + 01;
                DateTime YYY, DDD;
                YYY      = Convert.ToDateTime(Date);
                DDD      = Convert.ToDateTime(Date);
                DDD      = DDD.AddMonths(+1).AddDays(-1);
                集計期間From = YYY;
                集計期間To   = DDD;
            }
        }
Exemple #24
0
 public void Alterar(DDD obj)
 {
     _dddRepository.Update(obj);
 }
Exemple #25
0
 public void Incluir(DDD obj)
 {
     _dddRepository.Add(obj);
 }
Exemple #26
0
        public Consulta(string consulta, DDD dic)
        {
            atributos = new List <Atributo>();
            string[] c   = consulta.Split(' ');
            int      val = consulta.IndexOf(' ');

            if (c.Contains("SELECT") && c.Contains("FROM"))
            {
                if (consulta.IndexOf("SELECT") != consulta.LastIndexOf("SELECT"))
                {
                    string a = "";
                    int    inic = consulta.IndexOf('('), fin = consulta.IndexOf(')');
                    a = consulta.Substring(inic + 1, fin - inic - 1);
                    //consulta.Remove(inic, fin - inic + 1);
                    Consulta con = new Consulta(a, dic);
                    tablaQuery = con.tablaOut;
                }
                else
                {
                    //if (!c.Contains("WHERE"))
                    //    tablaQuery = dic.EntidadesOrden.Find(o => o.shortName.CompareTo(c.Last()) == 0);
                    //else
                    {
                        int i;
                        for (i = 0; i < c.Length && c[i].CompareTo("FROM") != 0; i++)
                        {
                            ;
                        }
                        tablaQuery = dic.EntidadesOrden.Find(o => o.shortName.CompareTo(c[i + 1]) == 0);
                    }
                    if (tablaQuery == null)
                    {
                        error += "Error: Tabla no encontrada \t\n";
                    }
                }
                join = joinOn(c, dic);
                //string atributo = consulta.Substring(consulta.IndexOf("SELECT"));
                int v = 1;
                if (tablaQuery == null)
                {
                    return;
                }
                while (error == "" && tablaQuery != null && c[v].CompareTo("FROM") != 0)
                {
                    if (!join && c[v].CompareTo("*") == 0)
                    {
                        atributos.AddRange(tablaQuery.Atrib);
                    }
                    else if (!join)
                    {
                        Atributo atr;//= tablaQuery.Atrib.Find(o => o.sNombre.Contains(c[v]));
                        if ((atr = tablaQuery.Atrib.Find(o => o.sNombre.Contains(c[v]))) != null)
                        {
                            atributos.Add(atr);
                        }
                        else
                        {
                            error += "Error: Atributo no encontrado";
                        }
                    }
                    else if (join) //si hay join
                    {
                        //recuperamos el campo a checar
                        string[] a = c[v].Split('.');
                        if (tablaQuery.shortName.CompareTo(a.First()) == 0) // si esta en la tabla query entra
                        {
                            buscaAtributo(tablaQuery, a.Last());
                        }
                        else if (tablaJoin.shortName.CompareTo(a.First()) == 0) // Si esta en la tabla join entra
                        {
                            buscaAtributo(tablaJoin, a.Last());
                        }
                        else // si no esta en ninguna es error
                        {
                            error += "Error: Tabla no declarada en la sentencia";
                        }
                    }
                    else
                    {
                        error += "Error: Sintaxis";
                    }
                    v++;
                }
                if (error != "")
                {
                    return;
                }


                //Join on

                //sin join on
                if (!join)
                {
                    tablaOut = new Entidad(atributos, registros(atributos, tablaQuery));
                    where (v, c);
                }
                else
                {
                    //var res = regQ.Select();
                    var reg = registros();
                    if (reg != null)
                    {
                        tablaOut = new Entidad(atributos, registros());
                    }
                }
                {
                    /*if (c.Contains("WHERE"))// si hay un where
                     * {
                     *  v += 2;
                     *  do
                     *  {
                     *      v++;
                     *      //No encuentra el atributo coorrecto
                     *      Atributo atri = atributos.Find(o => o.sNombre.CompareTo(c[v]) != 0);//tablaOut.Atrib.Find(o => o.sNombre.Contains(c[v]));
                     *      int index = atributos.IndexOf(atri);
                     *      v++;
                     *      string op = c[v];
                     *      v++;
                     *      string com = c[v];
                     *      for (int i = 0; error == "" && i < tablaOut.Registros.Count; i++)
                     *      {
                     *          List<string> r = tablaOut.Registros[i];
                     *          switch (op)
                     *          {
                     *              case ">":
                     *                  if (Convert.ToInt32(com) >= Convert.ToInt32(r[index + 1]))
                     *                  {
                     *                      tablaOut.Registros.Remove(r);
                     *                      i--;
                     *                  }
                     *                  break;
                     *              case "<":
                     *                  if (Convert.ToInt32(com) <= Convert.ToInt32(r[index + 1]))
                     *                  {
                     *                      tablaOut.Registros.Remove(r);
                     *                      i--;
                     *                  }
                     *                  break;
                     *              case "=":
                     *                  if (com != r[index + 1])
                     *                  {
                     *                      tablaOut.Registros.Remove(r);
                     *                      i--;
                     *                  }
                     *                  break;
                     *              case "<>":
                     *                  if (com == r[index + 1])
                     *                  {
                     *                      tablaOut.Registros.Remove(r);
                     *                      i--;
                     *                  }
                     *                  break;
                     *              case "<=":
                     *                  if (Convert.ToInt32(com) < Convert.ToInt32(r[index + 1]))
                     *                  {
                     *                      tablaOut.Registros.Remove(r);
                     *                      i--;
                     *                  }
                     *                  break;
                     *              case ">=":
                     *                  if (Convert.ToInt32(com) > Convert.ToInt32(r[index + 1]))
                     *                  {
                     *                      tablaOut.Registros.Remove(r);
                     *                      i--;
                     *                  }
                     *                  break;
                     *              default:
                     *                  error += "Error: Sintaxis";
                     *                  break;
                     *          }
                     *      }
                     *
                     *      //v++;
                     *  } while (v + 3 < c.Length);
                     * }*/
                }
            }
            else
            {
                error += "Error: Síntaxis";
            }
        }
Exemple #27
0
        private bool joinOn(string[] c, DDD dic)
        {
            int inner = -1, join = -1, on = -1, from = -1;

            inner = Array.IndexOf(c, "INNER");
            join  = Array.IndexOf(c, "JOIN");
            on    = Array.IndexOf(c, "ON");

            from = Array.IndexOf(c, "FROM");

            if (from + 1 < inner && inner < join && join + 1 < on)
            {
                //la sentencia del inner join esta completa y en el orden correspondiente.
                if (c[from + 1] != "" && c[join + 1] != "" && c[on + 1] != "") // si el nombre de las tablas no es vacio
                {
                    //buscar las tablas la tabla del from ya esta es tablaOut
                    tablaJoin = dic.EntidadesOrden.Find(o => o.shortName.CompareTo(c[join + 1]) == 0);
                    if (tablaQuery != null && tablaJoin != null)
                    {
                        // las tablas existen
                        var atr1 = c[on + 1].Split('.');
                        var atr2 = c[on + 3].Split('.');
                        if (tablaQuery.shortName.CompareTo(atr1[0]) == 0)
                        {
                            cond.Add(tablaQuery);
                            var a = tablaQuery.Atrib.FindIndex(o => o.sNombre.Split(' ')[0].CompareTo(atr1[1]) == 0);
                            if (a > 0 && tablaQuery.Atrib[a].Tipo != 'C')
                            {
                                cond.Add(a);
                                string exOp = "(=|>|<)";
                                if (new System.Text.RegularExpressions.Regex(exOp).IsMatch(c[on + 2]))
                                {
                                    cond.Add(c[on + 2]);
                                }
                            }
                            if (tablaJoin.shortName.CompareTo(atr2[0]) == 0)
                            {
                                cond.Add(tablaJoin);
                                a = tablaJoin.Atrib.FindIndex(o => o.sNombre.Split(' ')[0].CompareTo(atr2[1]) == 0);
                                if (a > 0 && tablaJoin.Atrib[a].Tipo != 'C')
                                {
                                    cond.Add(a);
                                }
                            }
                        }
                        else if (tablaJoin.shortName.CompareTo(atr1[0]) == 0)
                        {
                            cond.Add(tablaJoin);
                            var a = tablaJoin.Atrib.FindIndex(o => o.sNombre.Split(' ')[0].CompareTo(atr1[1]) == 0);
                            if (a >= 0 && tablaJoin.Atrib[a].Tipo != 'C')
                            {
                                cond.Add(a);
                                string exOp = "(=|>|<)";
                                if (new System.Text.RegularExpressions.Regex(exOp).IsMatch(c[on + 2]))
                                {
                                    cond.Add(c[on + 2]);
                                }
                            }

                            if (tablaQuery.shortName.CompareTo(atr2[0]) == 0)
                            {
                                cond.Add(tablaQuery);
                                a = tablaQuery.Atrib.FindIndex(o => o.sNombre.Split(' ')[0].CompareTo(atr2[1]) == 0);
                                if (a >= 0 && tablaQuery.Atrib[a].Tipo != 'C')
                                {
                                    cond.Add(a);
                                }
                            }
                        }

                        return(true);
                    }
                }
                else
                {
                    error += "Error: En INNER JOIN";
                }
                //return true;
            }
            return(false);
        }
 protected override bool EqualsCore(PhoneVO other)
 {
     return(DDD.Equals(other.DDD) && Number.Equals(other.Number));
 }
Exemple #29
0
 public static extern bool DefineDosDevice(DDD dwFlags, string lpDeviceName, string lpTargetPath);
 public virtual bool ValidarDDD()
 {
     return(Regex.IsMatch(DDD.ToString(), @"\A[0-9]{2}\Z"));
 }
Exemple #31
0
        public void Publish(
			DDD.ATM.Commands.ICommand command)
        {
            this.c_commandRouter.Route(command);
        }
Exemple #32
0
 public static extern bool DefineDosDevice(
     DDD dwFlags, [In] [MarshalAs(UnmanagedType.LPTStr)] string lpDeviceName, [In] [MarshalAs(UnmanagedType.LPTStr)] string lpTargetPath);
 public void Atualizar(Guid id, DDD ddd)
 {
     _dddRepository.Atualizar(id, ddd);
 }
 public void Salvar(DDD ddd)
 {
     _dddRepository.Salvar(ddd);
 }
Exemple #35
0
 public static extern bool DefineDosDevice(DDD dwFlags, string lpDeviceName, string lpTargetPath);
Exemple #36
0
 public void Atualizar(Guid id, DDD ddd)
 {
     ddd.DddId = id;
     _context.Entry(ddd).State = EntityState.Modified;
     _context.SaveChanges();
 }
Exemple #37
0
        //作成月がNullの場合は今月の月を挿入
        private void Lost_Month(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(作成年))
            {
                string   Date;
                int      iDate;
                DateTime YYYY;
                YYYY  = DateTime.Today;
                Date  = Convert.ToString(YYYY);
                Date  = Date.Substring(0, 4);
                iDate = Convert.ToInt32(Date);
                作成年   = iDate.ToString();
            }

            if (string.IsNullOrEmpty(作成月))
            {
                string   Date;
                int      iDate;
                DateTime MM;
                MM    = DateTime.Today;
                Date  = Convert.ToString(MM);
                Date  = Date.Substring(5, 2);
                iDate = Convert.ToInt32(Date);
                作成月   = iDate.ToString();
            }

            if (!string.IsNullOrEmpty(作成締日))
            {
                int?換締日 = Convert.ToInt32(作成締日);
                if (換締日 < 31)
                {
                    string   Date = 作成年.ToString() + "/" + 作成月.ToString() + "/" + 01;
                    DateTime CheckDate;
                    if (!DateTime.TryParse(Date, out CheckDate))
                    {
                        return;
                    }
                    DateTime 作成年月 = Convert.ToDateTime(Date);
                    DateTime YYY, DDD, Test;
                    int      itest, i作成締日;
                    YYY = 作成年月.AddMonths(-1);
                    string test  = YYY.ToString();
                    string test2 = test;
                    Test = Convert.ToDateTime(test).AddMonths(+1).AddDays(-1);
                    string test3 = Test.ToString().Substring(8, 2);
                    itest = Convert.ToInt32(test3);
                    i作成締日 = Convert.ToInt32(作成締日);
                    if (itest < i作成締日)
                    {
                        test     = test.Substring(0, 7);
                        test     = test + "/" + itest;
                        YYY      = Convert.ToDateTime(test).AddDays(+1);
                        DDD      = YYY.AddMonths(+1).AddDays(-1);
                        集計期間From = YYY;
                        集計期間To   = DDD;
                    }
                    else
                    {
                        test     = test.Substring(0, 7);
                        test     = test + "/" + i作成締日.ToString();
                        YYY      = Convert.ToDateTime(test).AddDays(+1);
                        DDD      = Convert.ToDateTime(test).AddMonths(+1);
                        集計期間From = YYY;
                        集計期間To   = DDD;
                    }
                }
                else if (換締日 == 31)
                {
                    string   Date = 作成年.ToString() + "/" + 作成月.ToString() + "/" + 01;
                    DateTime CheckDate;
                    if (!DateTime.TryParse(Date, out CheckDate))
                    {
                        return;
                    }
                    DateTime YYY, DDD;
                    YYY      = Convert.ToDateTime(Date);
                    DDD      = Convert.ToDateTime(Date);
                    DDD      = DDD.AddMonths(+1).AddDays(-1);
                    集計期間From = YYY;
                    集計期間To   = DDD;
                }
            }
        }
Exemple #38
0
        public void Display(
			DDD.ATM.UI.Presenters.LoginPresenter subject)
        {
            this.OnAttemptLogin += subject.AttemptLogin;
            this.ShowDialog();
        }
Exemple #39
0
 private void Kikan_Keisan()
 {
     if (作成年 < 2 || (作成月 < 1 || 作成月 > 12) || (作成締日 < 1 || 作成締日 > 31))
     {
         this.ErrorMessage = "入力値エラーです。もう一度入力してください。";
         MessageBox.Show("入力値エラーです。もう一度入力してください。");
         SetFocusToTopControl();
         ReturnValue = 0;
         return;
     }
     else
     {
         if (作成締日 < 31)
         {
             string   Date = 作成年.ToString() + "/" + 作成月.ToString() + "/" + 01;
             DateTime 作成年月 = Convert.ToDateTime(Date);
             DateTime YYY, DDD, Test;
             int      itest, i作成締日;
             YYY = 作成年月.AddMonths(-1);
             string test  = YYY.ToString();
             string test2 = test;
             Test = Convert.ToDateTime(test).AddMonths(+1).AddDays(-1);
             string test3 = Test.ToString().Substring(8, 2);
             itest = Convert.ToInt32(test3);
             i作成締日 = Convert.ToInt32(作成締日);
             if (itest < i作成締日)
             {
                 test     = test.Substring(0, 7);
                 test     = test + "/" + itest;
                 YYY      = Convert.ToDateTime(test).AddDays(+1);
                 DDD      = YYY.AddMonths(+1).AddDays(-1);
                 集計期間From = YYY;
                 集計期間To   = DDD;
             }
             else
             {
                 test     = test.Substring(0, 7);
                 test     = test + "/" + i作成締日.ToString();
                 YYY      = Convert.ToDateTime(test).AddDays(+1);
                 DDD      = Convert.ToDateTime(test).AddMonths(+1);
                 集計期間From = YYY;
                 集計期間To   = DDD;
             }
         }
         else if (作成締日 == 31)
         {
             string   Date = 作成年.ToString() + "/" + 作成月.ToString() + "/" + 01;
             DateTime YYY, DDD;
             YYY      = Convert.ToDateTime(Date);
             DDD      = Convert.ToDateTime(Date);
             DDD      = DDD.AddMonths(+1).AddDays(-1);
             集計期間From = YYY;
             集計期間To   = DDD;
         }
         if (集計期間From == null || 集計期間To == null)
         {
             ReturnValue = 0;
         }
         else
         {
             DateTime Wk;
             DateTime p集計期間To, p集計期間From;
             p集計期間To     = DateTime.TryParse(集計期間To.ToString(), out Wk) ? Wk : DateTime.Today;
             p集計期間From   = DateTime.TryParse(集計期間From.ToString(), out Wk) ? Wk : DateTime.Today;
             ReturnValue = 1;
             TimeSpan span = p集計期間To - p集計期間From;
             期間日数 = span.Days;
         }
     }
 }
Exemple #40
0
 public void Salvar(DDD ddd)
 {
     ddd.DddId = Guid.NewGuid();
     _context.DDD.Add(ddd);
     _context.SaveChanges();
 }