Example #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (hact.Value == "edit")
            {
                SaleAccountType account = SaleAccountType.findById(cvt.ToInt(hid.Value));
                account.PlatformCode = ddlPlatform.Text;
                account.UserName = txtUserName.Value.Trim();
                account.AccountManager = txtManager.Value.Trim();
                account.ApiToken = txtAPIToKen.Value.Trim();
                account.Description = txtDesc.Value.Trim();
                account.ManagerPhone = txtTel.Value.Trim();
                account.AccountStatus = ckStatus.Checked ? "停用" : "正常";

                account.update();
            }
            else
            {
                SaleAccountType account = new SaleAccountType();
                account.PlatformCode = ddlPlatform.SelectedValue;
                account.UserName = txtUserName.Value.Trim();
                account.ApiToken = txtAPIToKen.Value.Trim();

                account.AccountStatus = ckStatus.Checked ? "停用" : "正常";
                account.AccountManager = txtManager.Value.Trim();
                account.Description = txtDesc.Value.Trim();
                account.ManagerPhone = txtTel.Value.Trim();
                account.insert();

            }
        }