Exemplo n.º 1
0
            public override OutputData DoAction(IInputData input)
            {
                fResolver.Select("CODE_PY IS NULL OR CODE_PY = ''");
                DataTable table = fResolver.HostTable;

                foreach (DataRow row in table.Rows)
                {
                    row["Py"] = PinYinUtil.GetPyHeader(row["Name"].ToString(), string.Empty);
                }
                fResolver.SetCommands(AdapterCommand.Update);
                fResolver.UpdateDatabase();

                return(OutputData.CreateToolkitObject(KeyData.Empty));
            }
Exemplo n.º 2
0
        protected override void OnUpdatedRow(UpdatingEventArgs e)
        {
            base.OnUpdatedRow(e);

            if (e.Status == UpdateKind.Insert)
            {
                if (AutoCreatekey)
                {
                    e.Row[DecoderConst.CODE_NICK_NAME] = fCreator.CreateId(Context, TableName);
                }
                if (string.IsNullOrEmpty(e.Row["Py"].ToString()))
                {
                    e.Row["Py"] = PinYinUtil.GetPyHeader(
                        e.Row[DecoderConst.NAME_NICK_NAME].ToString(), string.Empty);
                }
            }
        }