예제 #1
0
        /// <summary>
        /// 更新關賬日期
        /// </summary>
        /// <param name="row">row</param>
        /// <returns>com_departmentInfo</returns>
        public void UpdateCloseDate(Js.Model.BusinessUnit.ParameterInfo model)
        {
            string strSql = string.Format("Update Sys_Parameter set CloseDate='{0}',LastModifyDate='{1}',LastModifyUserName='******'",
                            model.CloseDate.ToString("yyyy/MM/dd"), model.LastModifyDate.ToString("yyyy/MM/dd HH:mm"), model.LastModifyUserName);

            ia.ExecuteNonQuerySql(strSql);
        }
예제 #2
0
        /// <summary>
        /// 更新公司資料
        /// </summary>
        /// <param name="row">row</param>
        /// <returns>com_departmentInfo</returns>
        public void Update(Js.Model.BusinessUnit.CompanyInfo model,string No)
        {
            string strSql = "select * from Sys_Company";
            DataTable dt = ia.ExecuteDataSetSql(strSql).Tables[0];
            if (dt.Rows.Count > 0)
            {

                strSql = string.Format("Update Sys_Company set CompanyNo='{0}', CompanyName='{1}', UnionID='{2}', President='{3}', Phone='{4}', Fax='{5}', " +
                            "RegisterAddress='{6}', WebUrl='{7}', EnglishName='{8}', EnglishAddress='{9}', CreateDate={10}, CreateUserName='******'," +
                            "LastModifyDate={12},LastModifyUserName='******'",
                            model.CompanyNo, model.CompanyName, model.UnionID, model.President, model.Phone, model.Fax, model.RegisterAddress,
                            model.WebUrl, model.EnglishName, model.EnglishAddress,
                            model.CreateDate, model.CreateUserName, model.LastModifyDate, model.LastModifyUserName);
            }
            else
            {

                strSql = string.Format("insert into Sys_Company( CompanyNo, CompanyName, UnionID, President, Phone, Fax, " +
                                "RegisterAddress, WebUrl, EnglishName, EnglishAddress, CreateDate, CreateUserName,LastModifyDate, " +
                                "LastModifyUserName, CheckDate, CheckUserName) values " +
                                "'{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}',{10},'{11}',{12},'{13}'",
                                model.CompanyNo, model.CompanyName, model.UnionID, model.President, model.Phone, model.Fax, model.RegisterAddress,
                                model.WebUrl, model.EnglishName, model.EnglishAddress,
                                model.CreateDate, model.CreateUserName, model.LastModifyDate, model.LastModifyUserName);
            }
            ia.ExecuteNonQuerySql(strSql);
        }
예제 #3
0
 public ScriptAsset(Js? asset)
     : this()
 {
     foreach (var o in Dictionary.Where(o => (asset & o.Key) == o.Key))
     {
         HashSet.Add(o.Value);
     }
 }
예제 #4
0
        /// <summary>
        /// �s�W�@���O��
        /// </summary>
        /// <param name="_Accounts_UsersModel">SBAA_unts_Users����</param>
        public void Add(Js.Model.Account.RoleInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into Accounts_Roles");
            strSql.Append("(RoleName,UserLevel,CreateDate,CreateUserName,LastModifyDate,LastModifyUserName)");
            strSql.Append(" values ");
            strSql.Append("(@RoleName,@UserLevel,GetDate(),@CreateUserName, GetDate(),@LastModifyUserName)");

            SqlParameter[] parameters ={
                     new SqlParameter("@RoleName",SqlDbType.NVarChar,tf.GetTypeLength("RoleName")),
                     new SqlParameter("@UserLevel",SqlDbType.Int,tf.GetTypeLength("UserLevel")),
                     new SqlParameter("@CreateUserName",SqlDbType.NVarChar,tf.GetTypeLength("CreateUserName")),
                     new SqlParameter("@LastModifyUserName",SqlDbType.NVarChar,tf.GetTypeLength("LastModifyUserName"))
            };
            parameters[0].Value = model.RoleName.Trim();
            parameters[1].Value = model.UserLevel;
            parameters[2].Value = model.CreateUserName.Trim();
            parameters[3].Value = model.LastModifyUserName.Trim();

            ia.ExecuteNonQuerySql(strSql.ToString(), parameters);
        }
예제 #5
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            if (txt_New.Text != txt_NewConf.Text)
            {
                Js.AlertAndGoback("两次密码输入不一致");
                return;
            }
            else if (Voodoo.Security.Encrypt.Md5(txt_Old.Text) != u.UserPass)
            {
                Js.AlertAndGoback("密码错误,请重新输入!");
                return;
            }
            else
            {
                DataEntities ent = new DataEntities();

                var user = (from l in ent.User where l.ID == u.ID select l).FirstOrDefault();
                user.UserPass = Voodoo.Security.Encrypt.Md5(txt_New.Text);
                ent.SaveChanges();
                ent.Dispose();
                Js.AlertAndChangUrl("密码修改成功,请重新登录系统!", "/e/member/Logout.aspx");
            }
        }
예제 #6
0
        protected void next_Click(object sender, System.EventArgs e)
        {
            if (Cf.isMoney(nilai))
            {
                detildiv.Visible = true;
                nilaitr.Visible  = false;

                Alokasi(Convert.ToDecimal(nilai.Text));

                Js.Confirm(this, "Lanjutkan proses registrasi tanda terima sementara?");
            }
            else
            {
                Js.Alert(
                    this
                    , "Input Tidak Valid.\\n\\n"
                    + "Aturan Proses :\\n"
                    + "1. Nilai harus berupa angka.\\n"
                    , "document.getElementById('" + nilai.ID + "').focus();"
                    + "document.getElementById('" + nilai.ID + "').select();"
                    );
            }
        }
예제 #7
0
        public async Task <ActionResult> Create([Bind(Include = "UserId,ClientId,AppId,RoleId")] UserApp userApp)
        {
            var user = await new UserDB(db).FindOrCreate(userApp.UserId, User.Identity.GetUserId());

            if (user == null)
            {
                return(Json("Vui lòng chọn người dùng".GetError()));
            }
            var role = await new AppRoleDB(db).FindOrCreate(userApp.RoleId, userApp.AppId, userApp.ClientId);

            if (role == null)
            {
                return(Json("Vui lòng chọn quyền hạn".GetError()));
            }
            db.UserApps.Add(userApp);
            var str = await db.SaveMessageAsync();

            if (str != null)
            {
                return(Json(str.GetError()));
            }
            return(Json(Js.SuccessRedirect("Thêm mới người dùng thành công", "/admin/clientapps/edit?ClientId=" + userApp.ClientId + "&AppId=" + userApp.AppId)));
        }
예제 #8
0
        public override void VisitWhileStatement(WhileStatementSyntax node)
        {
            var topOfLoop = GetNextState();

            GotoState(topOfLoop);
            CurrentState = topOfLoop;

            var afterWhileStatement = GetNextState();
            var bodyState           = NewState();

            var newWhileStatement = Js.While(
                (JsExpression)node.Condition.Accept(Transformer),
                GotoStateBlock(bodyState));

            CurrentState.Add(newWhileStatement);
            GotoState(afterWhileStatement);

            CurrentState = bodyState;
            AcceptStatement(node.Statement, afterWhileStatement, topOfLoop);
            GotoState(topOfLoop);

            CurrentState = afterWhileStatement;
        }
예제 #9
0
        public async Task <ActionResult> FeatureAppsDelete(string id)
        {
            using (var db = new TDContext())
            {
                if (string.IsNullOrEmpty(id))
                {
                    return(Json(Js.SuccessRedirect("Đã cập nhật chức năng", "/admin/apps/FeatureApps")));
                }
                var data = await db.FeatureApps.FindAsync(id);

                if (data != null)
                {
                    db.FeatureApps.Remove(data);
                    var str = await db.SaveDatabase();

                    if (str != null)
                    {
                        return(Json(str.GetError()));
                    }
                }
                return(Json(Js.SuccessRedirect("Đã cập nhật chức năng", "/admin/products/FeatureApps")));
            }
        }
예제 #10
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Act.Pass();
            Cf.SetGrid(tb);

            if (!Page.IsPostBack)
            {
                Act.ProjectList(project);
                hasil.Visible = false;
                FillTerbaru();

                if (Request.QueryString["NoUnit"] != null)
                {
                    //dari floor plan
                    unit.Text = Request.QueryString["NoUnit"];
                    Fill();
                    hasil.Visible = true;
                }
            }

            Js.Focus(this, unit);
            //Js.ConfirmKeyword(this, unit);
        }
예제 #11
0
파일: AppFeatures.cs 프로젝트: cnstandat/TD
        public async Task <ActionResult> AppFeaturesDelete(string AppId, string FeatureAppId)
        {
            if (string.IsNullOrEmpty(AppId) || string.IsNullOrEmpty(FeatureAppId))
            {
                return(Json(this.GetNoData()));
            }
            using (var db = new TDContext())
            {
                var data = await db.AppFeatures.FindAsync(AppId, FeatureAppId);

                if (data != null)
                {
                    db.AppFeatures.Remove(data);
                    var str = await db.SaveDatabase();

                    if (str != null)
                    {
                        return(Json(str.GetError()));
                    }
                }
                return(Json(Js.SuccessRedirect(Global.FeatureAppAppChanged, Resources.AdminAppEditLink + AppId)));
            }
        }
        protected override async Task OnInitializedAsync()
        {
            ThemeNames = await Js.GetThemeNamesAsync();

            CurrentThemeName = IsStorageEnabled
                ? await Js.StorageGetItemAsync(ThemeStorageKey)
                : string.Empty;

            if (string.IsNullOrWhiteSpace(CurrentThemeName))
            {
                CurrentThemeName = DefaultThemeName;
            }

            if (IsStorageEnabled)
            {
                await Js.StorageSetItemAsync(ThemeStorageKey, CurrentThemeName);
            }

            await Js.ApplyThemeAsync(CurrentThemeName);

            $"Loaded {ThemeNames?.Count} themes. Current Theme: {CurrentThemeName}"
            .Log(nameof(CandyThemeManager), nameof(OnInitializedAsync));
        }
예제 #13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Act.Pass();
            Act.NoCache();

            if (!Act.Sec("ED:" + Request.PhysicalPath))
            {
                ok.Enabled   = true;
                save.Enabled = true;
            }

            if (!Page.IsPostBack)
            {
                //btnpop.Attributes["onclick"] = "popDaftarVA('" + NoUnit + "')";

                //nova.Attributes.Add("readonly", "readonly");
                validNilai(); //validasi input nilai
                Fill();
            }

            FeedBack();
            Js.Confirm(this, "Lanjutkan proses edit kontrak?\\n");
        }
예제 #14
0
 public JsNode VisitResolveResult(ResolveResult res)
 {
     if (res.Type == SpecialType.NullType)
     {
         return(Js.Null());
     }
     else if (res.Type.IsVoid())
     {
         Log.Warn("void");
         return(Js.CodeExpression("void"));
     }
     else if (res.Type.Kind == TypeKind.Dynamic)
     {
         var info = res.GetInfo();
         if (info == null || info.Nodes.Count != 1)
         {
             throw new NotImplementedException("Dynamics");
         }
         var node2 = Visit(info.Nodes[0]);
         return(node2);
     }
     throw new NotImplementedException();
 }
예제 #15
0
        private void Tampil()
        {
            list.Visible    = true;
            reprint.Visible = false;
            Js.AutoPrint(this);

            //increment
            Db.Execute("UPDATE MS_TTS SET PrintFPS = PrintFPS + 1 WHERE NoTTS = " + NoTTS);

            //Logfile
            DataTable rs = Db.Rs("SELECT "
                                 + " CONVERT(varchar, TglTTS, 106) AS [Tanggal]"
                                 + ",Tipe"
                                 + ",Ref AS [Ref.]"
                                 + ",Unit"
                                 + ",Customer"
                                 + ",CaraBayar AS [Cara Bayar]"
                                 + ",Ket AS [Keterangan]"
                                 + ",Total"
                                 + ",NoBG AS [No. BG]"
                                 + ",CONVERT(varchar, TglBG, 106) AS [Tanggal BG]"
                                 + ",NoFPS AS [No. FPS]"
                                 + " FROM MS_TTS WHERE NoTTS = " + NoTTS);

            Db.Execute("EXEC spLogTTS"
                       + " 'P-FPS'"
                       + ",'" + Act.UserID + "'"
                       + ",'" + Act.IP + "'"
                       + ",'" + Cf.LogCapture(rs) + "'"
                       + ",'" + NoTTS.ToString().PadLeft(7, '0') + "'"
                       );

            decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_TTS_LOG ORDER BY LogID DESC");
            string  Project = Db.SingleString("SELECT Project FROM " + Mi.DbPrefix + "MARKETINGJUAL..MS_KONTRAK WHERE NoKontrak = (SELECT Ref FROM MS_TTS WHERE NoTTS = '" + NoTTS + "')");

            Db.Execute("UPDATE MS_TTS_LOG SET Project = '" + Project + "' WHERE LogID  = " + LogID);
        }
예제 #16
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            DataEntities ent = new DataEntities();
            int          id  = WS.RequestInt("id");
            TemplateVar  tl  = new TemplateVar();

            try
            {
                tl = (from l in ent.TemplateVar where l.ID == id select l).First();
            }
            catch { }

            tl.VarName = txt_VarName.Text;
            tl.Content = txt_Content.Text.Replace("'", "''");

            if (tl.ID == null || tl.ID <= 0)
            {
                ent.AddToTemplateVar(tl);
            }
            ent.SaveChanges();

            var            pages = (from l in ent.TemplatePage where l.CreateWith == 5 select l).ToList();
            TemplateHelper th    = new TemplateHelper();

            foreach (var p in pages)
            {
                try
                {
                    string html = th.GetStatisPage(p.id);
                    Voodoo.IO.File.Write(Server.MapPath(p.FileName), html);
                }
                catch { }
            }

            ent.Dispose();
            Js.AlertAndChangUrl("保存成功!", "VarTemplateList.aspx");
        }
예제 #17
0
        protected async Task ExportErrors()
        {
            string    FileName = $"export_{DateTime.Now.ToShortDateString()}.xlsx";
            var       memory   = new MemoryStream();
            IWorkbook workbook;

            workbook = new XSSFWorkbook();
            ISheet excelSheet = workbook.CreateSheet($"Errors_{DateTime.Now.ToShortDateString()}");
            IRow   row        = excelSheet.CreateRow(0);
            int    counter    = 1;

            row.CreateCell(0).SetCellValue("#");
            row.CreateCell(1).SetCellValue("Insert");
            row.CreateCell(2).SetCellValue("User");
            row.CreateCell(3).SetCellValue("Level");
            row.CreateCell(4).SetCellValue("Error");
            row.CreateCell(5).SetCellValue("Stack Trace");

            foreach (var item in Model.Where(r => r.InsertDate >= StartDate && r.InsertDate < EndDate))
            {
                row = excelSheet.CreateRow(counter);
                row.CreateCell(0).SetCellValue(item.Id);
                row.CreateCell(1).SetCellValue(item.InsertDate.ToString("dd.MM.yy hh:mm:ss"));
                row.CreateCell(2).SetCellValue(item.UserData);
                row.CreateCell(3).SetCellValue(item.ErrorLevel.ToString());
                row.CreateCell(4).SetCellValue(item.ErrorMsg);
                row.CreateCell(5).SetCellValue(item.ErrorContext);
                counter++;
            }
            workbook.Write(memory);
            var fileData = memory.ToArray();

            await Js.InvokeAsync <object>(
                "saveAsFile",
                FileName,
                fileData);
        }
예제 #18
0
        public override void VisitSwitchStatement(SwitchStatementSyntax node)
        {
            var afterSwitchState = GetNextState();

            var sectionStates      = node.Sections.Select(x => GetNextState()).ToArray();
            var newSwitchStatement = Js.Switch(
                (JsExpression)node.Expression.Accept(Transformer),
                node.Sections
                .Select((x, i) =>
            {
                var section = Js.Section(x.Labels.Select(y => y.Kind() == SyntaxKind.CaseSwitchLabel ?
                                                         Js.CaseLabel((JsExpression)((CaseSwitchLabelSyntax)y).Value.Accept(Transformer)) :
                                                         Js.DefaultLabel()).ToArray());
                section.Statements.AddRange(GotoStateStatements(sectionStates[i]));
                return(section);
            })
                .ToArray());

            CurrentState.Add(newSwitchStatement);
            GotoState(afterSwitchState);

            Accept(() =>
            {
                for (var i = 0; i < node.Sections.Count; i++)
                {
                    var section      = node.Sections[i];
                    var sectionState = sectionStates[i];
                    CurrentState     = sectionState;
                    foreach (var statement in section.Statements)
                    {
                        AcceptStatement(statement);
                    }
                }
            }, afterSwitchState);

            CurrentState = afterSwitchState;
        }
예제 #19
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Act.Pass();
            Act.NoCache();

            if (!IsPostBack)
            {
                nokontrak.Attributes["ondblclick"] = "popDaftarKontrak('a&kpr=1');";

                if (Request.QueryString["NoKontrak"] != null)
                {
                    nokontrak.Text = Request.QueryString["NoKontrak"];
                    LoadKontrak();
                }
                else
                {
                    Js.Focus(this, nokontrak);
                    frm.Visible = false;
                }

                nilai.Attributes["onfocus"] = "tempnum=CalcFocus(this);tempx=this.value";
                nilai.Attributes["onkeyup"] = "CalcType(this,tempnum);";
                nilai.Attributes["onblur"]  = "CalcBlur(this);";

                tambahum.Attributes["onfocus"] = "tempnum=CalcFocus(this);tempx=this.value";
                tambahum.Attributes["onkeyup"] = "CalcType(this,tempnum);";
                tambahum.Attributes["onblur"]  = "CalcBlur(this);";

                tgljtum.Text = Cf.Day(DateTime.Today.AddDays(1));
            }

            FeedBack();
            if (frm.Visible)
            {
                Js.Confirm(this, "Lanjutkan proses pencatatan aktivitas Edit SP3K?");
            }
        }
예제 #20
0
        private void Tampil()
        {
            list.Visible    = true;
            reprint.Visible = false;
            Js.AutoPrint(this);

            //increment
            Db.Execute("UPDATE MS_KONTRAK SET PrintFPS = PrintFPS + 1 WHERE NoKontrak = '" + NoKontrak + "'");

            //Logfile

            DataTable rs = Db.Rs("SELECT "
                                 + " CONVERT(varchar, TglKontrak, 106) AS [Tanggal]"
                                 + ",NoKontrak AS [No Kontrak]"
                                 + ",NoCustomer AS [No Customer]"
                                 + ",Gross"
                                 + ",NoUnit AS [No Unit]"
                                 + ",NoAJB AS [No AJB]"
                                 + ",CaraBayar AS [Cara Bayar]"
                                 + ",KetWawancara AS [Keterangan]"
                                 + ",NilaiKontrak AS [Nilai Kontrak]"
                                 + ",NoFPS AS [No. FPS]"
                                 + " FROM MS_KONTRAK WHERE NoKontrak = '" + NoKontrak + "'");

            Db.Execute("EXEC spLogKontrak"
                       + " 'P-FPS'"
                       + ",'" + Act.UserID + "'"
                       + ",'" + Act.IP + "'"
                       + ",'" + Cf.LogCapture(rs) + "'"
                       + ",'" + NoKontrak.ToString().PadLeft(7, '0') + "'"
                       );

            decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_KONTRAK_LOG ORDER BY LogID DESC");
            string  Project = Db.SingleString("SELECT Project FROM MS_KONTRAK WHERE NoKontrak = '" + NoKontrak + "'");

            Db.Execute("UPDATE MS_KONTRAK_LOG SET Project = '" + Project + "' WHERE LogID  = " + LogID);
        }
예제 #21
0
        public override void VisitForEachStatement(ForEachStatementSyntax node)
        {
            // Hoist the variable into a field
            var symbol     = (ILocalSymbol)ModelExtensions.GetDeclaredSymbol(Transformer.Model, node);
            var identifier = HoistVariable(new LiftedVariableKey(node.Identifier, symbol));

            // Hoist the enumerator into a field
            var enumerator = HoistVariable(new LiftedVariableKey(identifier.Name + "$enumerator"));

            CurrentState.Add(
                enumerator.GetReference().Assign(
                    ((JsExpression)node.Expression.Accept(Transformer)).Member("GetEnumerator").Invoke()
                    ).Express()
                );

            var topOfLoop = GetNextState();

            GotoState(topOfLoop);
            CurrentState = topOfLoop;

            var afterLoop = GetNextState();
            var bodyState = GetNextState();

            var moveNext          = enumerator.GetReference().Member("MoveNext").Invoke();
            var newWhileStatement = Js.While(moveNext, GotoStateBlock(bodyState));

            CurrentState.Add(newWhileStatement);
            GotoState(afterLoop);

            CurrentState = bodyState;
            CurrentState.Add(identifier.GetReference().Assign(enumerator.GetReference().Member("get_Current").Invoke()).Express());

            AcceptStatement(node.Statement, afterLoop, topOfLoop);
            GotoState(topOfLoop);

            CurrentState = afterLoop;
        }
예제 #22
0
        private bool valid()
        {
            bool x = true;

            int c = Db.SingleInteger(
                "SELECT COUNT(*) FROM MS_KONTRAK WHERE NoKontrak = '" + NoKontrak + "' AND Status = 'A' and CaraBayar = 'KPR'");

            if (c == 0)
            {
                x = false;
            }

            int a = Db.SingleInteger("SELECT COUNT(*) FROM MS_KONTRAK WHERE NoKontrak = '" + NoKontrak + "' AND StatusSP3K = 'SELESAI'");

            if (a == 0)
            {
                x = false;
            }


            if (!x)
            {
                Js.Alert(
                    this
                    , "Kontrak Tidak Valid.\\n\\n"
                    + "Kemungkinan Sebab :\\n"
                    + "1. Kontrak tersebut tidak terdaftar.\\n"
                    + "2. Kontrak tersebut sudah dibatalkan.\\n"
                    + "3. Kontrak tersebut bukan KPR.\\n"
                    + "4. Kontrak tersebut belum melalui proses SP3K sampai selesai.\\n"
                    , "document.getElementById('nokontrak').focus();"
                    + "document.getElementById('nokontrak').select();"
                    );
            }

            return(x);
        }
예제 #23
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Act.Pass();
            Act.NoCache();

            if (!Act.Sec("ED:" + Request.PhysicalPath))
            {
                //ok.Enabled = true;
                save.Enabled = true;
            }
            if (!Page.IsPostBack)
            {
                backbtn.Visible = false;
                nokontrak.Attributes["ondblclick"] = "popDaftarKontrak('a&ppjb=1');";
                //Fill();
                if (Request.QueryString["NoKontrak"] != null)
                {
                    //dariReminder.Checked = true;
                    nokontrak.Text = Request.QueryString["NoKontrak"];
                    LoadKontrak();

                    //cancel.Attributes["onclick"] = "location.href='ReminderPPJB.aspx'";
                }
                else
                {
                    Js.Focus(this, nokontrak);
                    frm.Visible = false;
                }
                if (frm.Visible)
                {
                    Js.Confirm(this, "Lanjutkan proses pencatatan berkas PPJB?");
                }
            }
            Fill();
            FeedBack();
            //Js.Confirm(this, "Lanjutkan proses pencatatan berkas ppjb?\\n");
        }
예제 #24
0
        protected void btn_createPage_Click(object sender, EventArgs e)
        {
            Class c = ClassView.GetModelByID(cls.ToS());

            string[] ids = WS.RequestString("id").Split(',');
            foreach (string id in ids)
            {
                MovieInfo mv = MovieInfoView.GetModelByID(id);
                CreatePage.CreateContentPage(mv, c);
                var kuaibos = MovieUrlKuaibView.GetModelList(string.Format("MovieID={0}", id));
                var baidus  = MovieUrlBaiduView.GetModelList(string.Format("MovieID={0}", id));
                var dramas  = MovieDramaView.GetModelList(string.Format("MovieID={0}", id));
                foreach (var kuaib in kuaibos)
                {
                    CreatePage.CreateDramapage(kuaib, c);
                }
                foreach (var baidu in baidus)
                {
                    CreatePage.CreateDramapage(baidu, c);
                }
                foreach (var drama in dramas)
                {
                    CreatePage.CreateDramapage(drama, c);
                }
            }

            if (cls > 0)
            {
                try
                {
                    CreatePage.CreateListPage(c, 1);
                }
                catch { }
            }
            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
예제 #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            User u = UserAction.opuser;

            if (u.ID <= 0)
            {
                Js.AlertAndChangUrl("对不起,您没有登录,请登陆后进行提问!", "/");
                return;
            }

            UserGroup g = UserGroupView.GetModelByID(u.Group.ToS());

            if (g.MaxPost <= 0)
            {
                Js.AlertAndGoback("对不起,您没有提问的权限!如有疑问,请联系管理员");
                return;
            }



            if (!IsPostBack)
            {
                var cls = NewsAction.NewsClass;
                cls = cls.Where(p => p.EnablePost && p.IsLeafClass && p.ModelID == 3).ToList();
                ddl_Class.DataSource     = cls;
                ddl_Class.DataTextField  = "ClassName";
                ddl_Class.DataValueField = "id";
                ddl_Class.DataBind();

                int rclass = WS.RequestInt("class");
                if (rclass > 0)
                {
                    ddl_Class.SelectedValue = rclass.ToS();
                    ddl_Class.Enabled       = false;
                }
            }
        }
예제 #26
0
 internal void VerifyCustomAttributesOnTypeAndMembers()
 {
     if (verifiedCustomAttributesOnTypeAndMembers)
     {
         return;
     }
     verifiedCustomAttributesOnTypeAndMembers = true;
     if (_JsType.customAttributes == null)
     {
         return;
     }
     for (var i = 0; i < _JsType.customAttributes.length; i++)
     {
         var attDef  = _JsType.customAttributes[i].As <JsAttribute>();
         var attType = JsTypeHelper.GetType(attDef.typeName);
         var jsCtor  = attType.As <JsObject>()[attDef.ctorName].As <JsFunction>();
         var att     = Js.ApplyNew(jsCtor, attDef.positionalArguments);
         if (attDef.namedArguments != null)
         {
             foreach (string propName in attDef.namedArguments)
             {
                 var value = attDef.namedArguments[propName];
                 if (Js.Typeof(value) == "function")
                 {
                     value = value.As <JsFunction>().call(null);
                 }
                 att.As <JsObject>()["set_" + propName].As <JsFunction>().call(att, value);
             }
         }
         var target = GetAttributeTarget(attDef.targetType, attDef.targetMemberName);
         if (target._CustomAttributes == null)
         {
             target._CustomAttributes = new JsExtendedArray();
         }
         target._CustomAttributes.push(att);
     }
 }
예제 #27
0
        protected void tambah(int index)
        {
            TableRow r = new TableRow();

            r.ID = "baris_" + index;
            TableCell       c;
            DropDownList    ddl;
            RadioButtonList rbl;
            TextBox         tb;

            ddl    = new DropDownList();
            ddl.ID = "lvlsales_" + index;
            LibMkt.ListLvlSales(ddl, Convert.ToInt32(tipe.SelectedValue), project.SelectedValue);

            c = new TableCell();
            c.Controls.Add(ddl);
            r.Cells.Add(c);

            tb    = new TextBox();
            tb.ID = "penjualan_" + index;
            Js.NumberFormat(tb);

            c = new TableCell();
            c.Controls.Add(tb);
            r.Cells.Add(c);

            tb    = new TextBox();
            tb.ID = "reward_" + index;


            c = new TableCell();
            c.Controls.Add(tb);
            r.Cells.Add(c);

            list.Controls.Add(r);
        }
예제 #28
0
        private void LoadKontrak()
        {
            if (valid())
            {
                pilih.Visible = false;
                frm.Visible   = true;

                InitForm();
                Fill();

                Js.Focus(this, disc);

                if (frm.Visible)
                {
                    Js.Confirm(this, "Lanjutkan proses diskon nilai kontrak?");
                }
            }
            else
            {
                backbtn.Visible = true;
                Js.Focus(this, nokontrak);
                frm.Visible = false;
            }
        }
예제 #29
0
        private bool valid()
        {
            bool x = true;

            baru.Text = Cf.Pk(baru.Text);
            if (Cf.isEmpty(baru))
            {
                x          = false;
                baruc.Text = "Kosong";
            }
            else
            {
                if (!unik())
                {
                    x          = false;
                    baruc.Text = "Duplikat";
                }
                else
                {
                    baruc.Text = "";
                }
            }

            if (!x)
            {
                Js.Alert(
                    this
                    , "Input Tidak Valid.\\n\\n"
                    + "Aturan Proses :\\n"
                    + "1. Kode User harus diisi dan tidak boleh duplikat.\\n"
                    , ""
                    );
            }

            return(x);
        }
예제 #30
0
        protected void upload_Click(object sender, System.EventArgs e)
        {
            if (!file.PostedFile.FileName.EndsWith(".xls"))
            {
                Js.Alert(
                    this
                    , "Proses Upload Gagal.\\n"
                    + "File yang boleh di-upload adalah file dengan extension .xls saja."
                    , ""
                    );
            }
            else
            {
                string path = Request.PhysicalApplicationPath
                              + "Template\\Titip_" + Session.SessionID + ".xls";

                Dfc.UploadFile(".xls", path, file);

                Cek(path);

                //Hapus file sementara tersebut dari hard-disk server
                Dfc.DeleteFile(path);
            }
        }
예제 #31
0
        public virtual ActionResult Delete(Int32 id)
        {
            var url = Request.UrlReferrer + "";

            try
            {
                var entity = Find(id);
                OnDelete(entity);

                Js.Alert("删除成功!").Redirect(url);
                return(new EmptyResult());
            }
            catch (Exception ex)
            {
                Js.Alert("删除失败!" + ex.Message).Redirect(url);
                return(new EmptyResult());
            }

            //// 跳转到来源地址
            //if (url != "")
            //    return Redirect(url);
            //else
            //    return RedirectToAction("Index");
        }
예제 #32
0
 public JsNode VisitTypeIsResolveResult(TypeIsResolveResult res)
 {
     if (Sk.OmitCasts(res.TargetType))
     {
         return(Js.True());
         //var node2 = Visit(res.Input);
         //return node2;
     }
     else if (Sk.NativeCasts(res.TargetType))
     {
         var typeFieldName = Sk.GetJsonTypeFieldName(res.TargetType.GetDefinitionOrArrayType());
         if (typeFieldName != null && Sk.IsJsonMode(res.TargetType.GetDefinitionOrArrayType()))
         {
             return(Js.Parentheses(VisitExpression(res.Input).Or(Js.Json())).Member(typeFieldName).Equal(SkJs.EntityTypeRefToMember(res.TargetType)));
         }
         var node2 = VisitExpression(res.Input).InstanceOf(SkJs.EntityTypeRefToMember(res.TargetType));
         return(node2);
     }
     else
     {
         var node2 = Js.Member("Is").Invoke(VisitExpression(res.Input), SkJs.EntityTypeRefToMember(res.TargetType));
         return(node2);
     }
 }
예제 #33
0
        void FillMethods(JsObject def)
        {
            var isStatic = def == _JsType.staticDefinition;

            foreach (var funcName in def)
            {
                if (funcName == "toString")
                {
                    continue;
                }
                var func = def[funcName].As <JsFunction>();
                if (Js.Typeof(func) != "function")
                {
                    continue;
                }
                var methodName = JsNamingHelper.JsFunctionNameToClrMethodName(funcName);
                var methods    = _MethodsByName[methodName];
                if (methods == null)
                {
                    methods = new JsArray <MethodInfo>();
                    _MethodsByName[methodName] = methods;
                }
                //TODO: check overrides and parameters
                var method = new JsImplMethodInfo();
                methods.push(method.As <MethodInfo>());
                _Methods.push(method);
                method._Name          = methodName;
                method.JsName         = funcName;
                method.JsFunction     = func;
                method._DeclaringType = this;
                method._IsStatic      = _JsType.staticDefinition != null && _JsType.staticDefinition[funcName] == func;
                //var propType = VM.resolveMemberType2(def, propName);
                //if (propType != null)
                //  prop._MethodType = _TypeOf(propType);
            }
        }
예제 #34
0
        private bool valid()
        {
            bool x = true;

            int c = Db.SingleInteger(
                "SELECT COUNT(*) FROM MS_KONTRAK WHERE NoKontrak = '" + NoKontrak + "' AND Status = 'A'");// AND ST <> 'D'");

            if (c == 0)
            {
                x = false;
            }

            int a = Db.SingleInteger(
                "SELECT COUNT(*) FROM MS_IMB WHERE NoKontrak = '" + NoKontrak + "' AND (StatusIMB='D' OR StatusIMB='T')");

            if (a > 0)
            {
                x = false;
            }

            if (!x)
            {
                Js.Alert(
                    this
                    , "Kontrak Tidak Valid.\\n\\n"
                    + "Kemungkinan Sebab :\\n"
                    + "1. Kontrak tersebut tidak terdaftar.\\n"
                    + "2. Kontrak tersebut sudah dibatalkan.\\n"
                    + "3. Prosedur IMB sudah dijalankan.\\n"
                    , "document.getElementById('nokontrak').focus();"
                    + "document.getElementById('nokontrak').select();"
                    );
            }

            return(x);
        }
예제 #35
0
 public static IAsset Script(Js? asset)
 {
     return new ScriptAsset(asset);
 }
예제 #36
0
 public void Update(Js.Model.Account.RoleInfo model)
 {
     dao.Update(model);
 }
예제 #37
0
 /// <summary>
 /// �s�W�@���O��
 /// </summary>
 /// <param name="_Com_DepartmentModel">SBAA_Department����</param>
 public void Add(Js.Model.Account.RoleInfo model)
 {
     dao.Add(model);
 }
예제 #38
0
 public override object Call(Js.IObj that, object[] args)
 {
     return Js.Undefined.Instance;
 }
예제 #39
0
        /// <summary>
        /// ��s�@���O��
        /// </summary>		
        /// <param name="_Accounts_UsersModel">_Accounts_UsersModel</param>
        public void Update(Js.Model.Account.RoleInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("Update Accounts_Roles Set ");
            strSql.Append("RoleName=@RoleName , ");
            strSql.Append("UserLevel=@UserLevel , ");
            strSql.Append("CreateDate=@CreateDate , ");
            strSql.Append("CreateUserName=@CreateUserName , ");
            strSql.Append("LastModifyDate=GetDate() , ");
            strSql.Append("LastModifyUserName=@LastModifyUserName  ");
            strSql.Append(" where 1=1");
            strSql.Append(" And RoleID=@RoleID ");

            SqlParameter[] parameters ={
                     new SqlParameter("@RoleID",SqlDbType.Int,tf.GetTypeLength("RoleID")),
                     new SqlParameter("@RoleName",SqlDbType.NVarChar,tf.GetTypeLength("RoleName")),
                     new SqlParameter("@UserLevel",SqlDbType.Int,tf.GetTypeLength("UserLevel")),
                     new SqlParameter("@CreateDate",SqlDbType.DateTime,tf.GetTypeLength("CreateDate")),
                     new SqlParameter("@CreateUserName",SqlDbType.NVarChar,tf.GetTypeLength("CreateUserName")),
                     new SqlParameter("@LastModifyUserName",SqlDbType.NVarChar,tf.GetTypeLength("LastModifyUserName"))

            };
            parameters[0].Value = model.RoleID;
            parameters[1].Value = model.RoleName.Trim();
            parameters[2].Value = model.UserLevel;
            parameters[3].Value = model.CreateDate;
            parameters[4].Value = model.CreateUserName.Trim();
            parameters[5].Value = model.LastModifyUserName.Trim();

            ia.ExecuteNonQuerySql(strSql.ToString(), parameters);
        }
예제 #40
0
 /// <summary>
 /// 更新公司資料
 /// </summary>
 /// <param name="row">row</param>
 /// <returns>com_departmentInfo</returns>
 public void Update(Js.Model.BusinessUnit.CompanyInfo model, string No)
 {
     dao.Update(model,No);
 }
예제 #41
0
 /// <summary>
 /// 更新關賬日期
 /// </summary>
 /// <param name="row">row</param>
 /// <returns>com_departmentInfo</returns>
 public void UpdateCloseDate(Js.Model.BusinessUnit.ParameterInfo model)
 {
     dao.UpdateCloseDate(model);
 }