Ejemplo n.º 1
0
        private StringBuilder PrepareDataJsonForSelectAlerts(ThongBaoModels model, int couter)
        {
            StringBuilder sbResult = new StringBuilder();

            try
            {
                sbResult.Append("{");
                sbResult.Append("\"col_class\":\"rows-box\",");
                sbResult.Append("\"col_id\":\"" + model.mathongbao + "\",");
                sbResult.Append("\"col_value\":[");
                #region Data cell
                //stt
                sbResult.Append("{");
                sbResult.Append("\"colspan\":\"1\",");
                sbResult.Append("\"col_class\":\"ovh col1 stt\",");
                sbResult.Append("\"col_value\":\"" + couter.ToString() + "\"");
                sbResult.Append("},");
                //noi dung
                sbResult.Append("{");
                sbResult.Append("\"colspan\":\"1\",");
                sbResult.Append("\"col_class\":\"ovh col2\",");
                sbResult.Append("\"title\":\"" + model.noidung + "\",");
                sbResult.Append("\"col_value\":\"" + model.noidung + "\"");
                sbResult.Append("},");
                //ngay nhap
                sbResult.Append("{");
                sbResult.Append("\"colspan\":\"1\",");
                sbResult.Append("\"col_class\":\"ovh col3\",");
                sbResult.Append("\"col_value\":\"" + FunctionsDateTime.GetDateTimeClientCustomFormat(model.ngaytao) + "\"");
                sbResult.Append("}");
                #endregion

                sbResult.Append("]");
                sbResult.Append("},");
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
            }
            return(sbResult);
        }
Ejemplo n.º 2
0
        public ActionResult Create(KeHoachModels model)
        {
            //check login
            if (!IsLogged())
            {
                return(BackToLogin());
            }
            #region Set Param
            M_KeHoach clParamSuKien = new M_KeHoach();
            clParamSuKien.noidungmuctieu = model.noidungmuctieu;
            clParamSuKien.ghichu         = model.ghichu;
            clParamSuKien.makehoach      = makehoach;
            clParamSuKien.ngaybatdau     = FunctionsDateTime.ConvertDate(FunctionsDateTime.ConvertStringToDate(model.ngaybatdau));
            clParamSuKien.ngayketthuc    = FunctionsDateTime.ConvertDate(FunctionsDateTime.ConvertStringToDate(model.ngayketthuc));
            clParamSuKien.nguoitao       = Session["userid"].ToString();
            clParamSuKien.nguoithuchien  = model.nguoithuchien;
            clParamSuKien.makehoachgoc   = model.makehoachgoc;
            clParamSuKien.tytrong        = model.tytrong;
            clParamSuKien.chitieunam     = model.chitieunam;
            clParamSuKien.ngaytao        = "GETDATE()";
            clParamSuKien.nguoihieuchinh = Session["userid"].ToString();
            clParamSuKien.ngayhieuchinh  = "GETDATE()";
            if (GetPhongBanDonVi() != null)
            {
                clParamSuKien.madonvi = GetPhongBanDonVi().madonvi;
            }
            #endregion

            KeHoachServices services = new KeHoachServices();

            if (makehoach.Trim() == "")
            {
                services.InsertRow(clParamSuKien, Session["manhansu"].ToString());
            }
            else
            {
                services.UpdateRow(clParamSuKien);
            }
            makehoach = "";
            return(RedirectToAction("Index", "Milestones"));
        }